Open Wo-m opened 2 months ago
definitely a time zone issue. this was done on a monday at 09:55 gst+10. Program is using gst time when finding last monday, so if i run this at 10am local time it will work. 19918 days since 1970-01-01 is a sunday
weekday 7
count from today to last monday 6
today time since epoch 19918
last monday time since epoch 19912
amount: -89.00 description: Beem createdAt: 2024-07-08T07:50:08+10:00 tag: NONE
amount: -20.21 description: San Churro createdAt: 2024-07-08T19:40:04+10:00 tag: NONE
amount: -4.40 description: FoodWorks createdAt: 2024-07-09T07:24:00+10:00 tag: NONE
amount: -16.05 description: Starbucks createdAt: 2024-07-09T09:37:26+10:00 tag: NONE
amount: -2.99 description: Apple createdAt: 2024-07-10T00:31:44+10:00 tag: NONE
amount: 722.23 description: tax return createdAt: 2024-07-12T00:00:00+10:00 tag: INCOME
amount: -1.00 description: Transport for NSW createdAt: 2024-07-12T08:11:55+10:00 tag: OPAL
amount: -5.50 description: Funkis Köket Café createdAt: 2024-07-12T09:47:33+10:00 tag: NONE
amount: -25.95 description: Anytime Fitness createdAt: 2024-07-12T13:00:19+10:00 tag: EXPECTED
amount: -11.15 description: The Village Inn Paddington createdAt: 2024-07-12T21:02:57+10:00 tag: NONE
amount: -18.98 description: Uber createdAt: 2024-07-12T21:36:38+10:00 tag: NONE
amount: -109.50 description: My Muscle Chef createdAt: 2024-07-13T02:09:28+10:00 tag: EXPECTED
amount: -7.21 description: Uber createdAt: 2024-07-13T08:36:41+10:00 tag: NONE
amount: -12.15 description: Sonoma createdAt: 2024-07-13T08:57:14+10:00 tag: NONE
amount: -14.29 description: Adobe createdAt: 2024-07-14T00:37:40+10:00 tag: EXPECTED
amount: -8.72 description: Transport for NSW createdAt: 2024-07-14T03:12:38+10:00 tag: OPAL
amount: -22.00 description: Dirty Red createdAt: 2024-07-14T08:17:24+10:00 tag: NONE
amount: -6.07 description: Sonoma createdAt: 2024-07-14T13:59:07+10:00 tag: NONE
amount: -8.72 description: Transport for NSW createdAt: 2024-07-15T01:41:21+10:00 tag: OPAL
amount: -4.30 description: FoodWorks createdAt: 2024-07-15T07:04:29+10:00 tag: NONE
amount: -1.00 description: Transport for NSW createdAt: 2024-07-15T08:03:19+10:00 tag: OPAL
amount: -14.99 description: Meta createdAt: 2024-07-15T08:52:00+10:00 tag: NONE
income: 722.23 expense: -404.18 total 318.05
EXPECTED: -149.74 OPAL: -19.44 NONE: -235.00
auto todays_date = date::floor<date::days>(std::chrono::system_clock::now());
auto weekday = date::weekday{todays_date};
fmt::print("weekday {}\n", weekday.iso_encoding());
fmt::print("count from today to last monday {}\n", (date::weekday{ todays_date } - date::Monday).count());
fmt::print("today time since epoch {}\n", todays_date.time_since_epoch().count());
fmt::print("last monday time since epoch {}\n", (todays_date - (date::weekday{ todays_date } - date::Monday)).time_since_epoch().count());
above final -89 transaction should not be included looks like it has something to do with aest +10, after 10am local (aest) all is good