-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed schedule editor to convert/save start time correctly #3671
Fixed schedule editor to convert/save start time correctly #3671
Conversation
@h-kataria - I see the date still not being saved correctly ( either once or hourly). |
13c6b06
to
9b71354
Compare
@lgalis @mzazrivec please review/test |
Tested, it seems to be working correctly, changes look good. @lgalis Laura, could you re-verify as well, please? Thanks. |
When a schedule is added or edited, the new date chosen is now shown correctly in the list of schedules. When the same schedule is open again for editing, it will still show the previous day. Update: to reproduce the problem, add a schedule for the current day , at say 22:10, time zone can stay UTC, save. |
Need to only pass date to create_time_in_utc method call, prior to fix code was passing in datetime as "Mon Mar 12 2018 20:00:00 GMT-0400 (EDT) 1:5:00", having timezone and time in the start_date parameter was messing the conversion up. Changed miq_datepicker.js to convert string into moment first and then convert it to utc, that solves the issue where Date being sent upto server was -1 day of selected day. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1558627
9b71354
to
413e81d
Compare
@lgalis please re-test, fixed test case where only time change to existing schedule was saving date as -1 day |
Checked commit h-kataria@413e81d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tested in the UI, thank you Harpreet!
Fixed schedule editor to convert/save start time correctly (cherry picked from commit b3adc09) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1560104
Gaprindashvili backport details:
|
Need to only pass date to create_time_in_utc method call, prior to fix code was passing in datetime as "Mon Mar 12 2018 20:00:00 GMT-0400 (EDT) 1:5:00", having timezone and time in the start_date parameter was messing the conversion up.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1558627
@lgalis please review/test
@dclarizio please review.
before:
![schedule_edit_before](https://user-images.githubusercontent.com/3450808/37739266-fb37b04e-2d2f-11e8-86bb-03aeb4ea780f.png)
after:
![schedule_edit_after](https://user-images.githubusercontent.com/3450808/37739259-f5f2c650-2d2f-11e8-9105-9d054ace8fba.png)