jigarius / toggl2redmine

Import time from Toggl 2 Redmine.
GNU General Public License v3.0
26 stars 6 forks source link

T2R should respect Locale of Red'User or_else Red'Server or_else BrowserClient #75

Open tonischilling opened 2 years ago

tonischilling commented 2 years ago

Bug summary When using T2R from Germany and picking a date in the DatePicker (or just use the current date), it will be transformed to the __date of the _previous day, giving a wrong search interval for the Redmine-TimeEntries__.

To Reproduce

  1. choose Timezone Germany in your Redmine-Account
  2. produce some Activities on some consecutive days (e.g October 4,3,2,1), Steps to reproduce the behavior:
  3. Go to '...'
  4. Click on '....'
  5. Scroll down to '....'
  6. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Device information

Additional context Add any other context about the problem here.

tonischilling commented 2 years ago

Hrrrg! Sorry, somehow I hit [save], before I finished the description.

tonischilling commented 2 years ago

Description continued ...

Steps to reproduce

  1. add comments to these activities (2./3./4.Okt), telling the date (:spent_on) of the activity: e.g. "am 2/3/4.Oktober"
  2. choose 4.Okt.2021 in T2R-DatePicker Table "Time-Logged-In-Redmine" will show "am 3.Oktober"

Expected result: Table "Time-Logged-In-Redmine" should show "am 4.Oktober"

tonischilling commented 2 years ago

I hacked this into t2r.js to find the reason: image

tonischilling commented 2 years ago

I got this in the Developer-Console: image Internally the time part of the ISO-string will be cut off and replaced by "00:00:00Z", giving us the previous day when fetching the Redmine entries.

tonischilling commented 2 years ago

my suggestion: Instead of dealing with the User-Locale on browser-side, it would be better, to send the picked date "as is" to the Rails-Action. On Rails-side the users | redmines |servers locale is well known, ...

tonischilling commented 2 years ago

Context: