fix: comply to two digit months as per API wanting YYYY-MM
This commit is contained in:
parent
700659ff60
commit
c394af7127
1 changed files with 3 additions and 2 deletions
5
main.go
5
main.go
|
|
@ -110,11 +110,12 @@ func (b BudgetClient) BankSync() bool {
|
|||
func (b BudgetClient) GetBudgetMonths() *BudgetMonthsResponse {
|
||||
currentTime := time.Now()
|
||||
year, month := currentTime.Year(), int(currentTime.Month())
|
||||
budgetMonth := fmt.Sprintf("%v-%v", year, month)
|
||||
budgetMonth := fmt.Sprintf("%v-%02d", year, month)
|
||||
resp := b.callApi("GET", "/months/"+budgetMonth, nil)
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status))
|
||||
temp, _ := io.ReadAll(resp.Body)
|
||||
log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status) + " " + string(temp))
|
||||
}
|
||||
var data bytes.Buffer
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue