powerpaul17 / nc_money

Nextcloud app for finance management
GNU Affero General Public License v3.0
96 stars 9 forks source link

Date on incomes/expenses is always one day behind #68

Closed moolicc closed 1 month ago

moolicc commented 1 month ago

Describe the bug When I add an item or edit the date on an existing item, when saved, the date always sets to a day prior to the selected date.

To Reproduce Steps to reproduce the behavior:

  1. Add an item to an Income or Expense sheet
  2. Observe that the date is one day prior to the selected date OR
  3. Edit the date on an existing item on an Income or Expense sheet
  4. Observe that the date is one day prior to the selected date

Expected behavior The date on the item is as it was selected.

Screenshots Even better, a short video :)

https://github.com/powerpaul17/nc_money/assets/28231505/a067d088-e9d5-4c3f-8eae-08646e058115

Nextcloud information (please complete the following information):

Nextcloud version: 27.1.9
App version: 0.25.1
PHP version: 8.2.18
Database type and version: mysql, 8.0.37

Desktop (please complete the following information):

OS: Windows 10
Browser: Edge and Firefox
Versions: 124, 126

Additional context Also shown in the above screen recording is an apparent issue with the UI margins for the items when it has to re-sort.

powerpaul17 commented 1 month ago

Thanks for the bug report. Since I've seen such things on different projects I suspect a time zone problematic. I'll have a look at it.

moolicc commented 1 month ago

Time zone math in js/ts is always fun (NOT).. I'm not sure how to navigate a Nextcloud plugin/app, but if you point me in the direction of the source where editing and/or adding items is done, I can give it a shot

powerpaul17 commented 1 month ago

Could you please send me the request data and the server response for the request which is sent when you change the date?

powerpaul17 commented 1 month ago

Also can you tell me in what time zone you are located? (If it's ok for you of course).

powerpaul17 commented 1 month ago

Fixed in 282e810bb4c02c822fc9e0db4b74cace35137d66

moolicc commented 1 month ago

Sorry for the delay.. Been busy lately. Thanks for getting this fixed, my apologies for not being available to give you the other information you had asked for.

moolicc commented 1 month ago

Okay so this doesn't seem to have fixed it entirely apparently.

I'm in the America/Chicago time zone, or Central Daylight Time currently (UTC-5).

After adding an expense, when I go to update the description on the row, after saving the row the date flips back a day, but I can't get this to reliably reproduce for the other columns in the row. Here are some screenshots of requests/responses from this test:

Adding the row:

  1. Transaction Request
  2. Transaction Response
  3. 1st Splits Request
  4. 1st Splits Response
  5. 2nd Splits Request
  6. 2nd Splits Response

transaction-req transaction1-resp splits1-req splits1-resp splits1-2-req splits1-2-resp

Updating the row:

(I'm not sure what to call these, as firefox just reports their name as "58".

  1. Update Request
  2. Update Response

update1-req

update1-resp

Note that I never changed the date in the UI, only the description.

I'll keep testing out different things and seeing if I can reproduce the behavior in other ways as well.

moolicc commented 1 month ago

Here's a video of me flipping some fields on that row and the date only seems to be weird when I change the description

https://github.com/powerpaul17/nc_money/assets/28231505/01008f09-0364-4904-9d5a-e2749c364b56

moolicc commented 1 month ago

And I am doing this testing at around 18:30 local time, which shouldn't even be rolling over to the next day if you add 5 hours to make it GMT.

powerpaul17 commented 1 month ago

Should be fixed now with e7fadcd0c0f126e2122d16c00f8aa5224aadc993. I'll run more tests and release it again soon.

moolicc commented 1 month ago

Once again, thank you sir for a quick fix to this!

powerpaul17 commented 1 month ago

And thank you for the detailed information and the bug report. Apparently there weren't many users in different time zones because it didn't bother anyone up to now.. :wink: