-
Notifications
You must be signed in to change notification settings - Fork 898
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
dynamic DatePicker value isn't being set correctly #18523
Conversation
@miq-bot add_label bug |
@miq-bot add_label hammer/yes |
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.
👍
Small correction to the description though: I don't think it was always called with a Time
object, since the value is coming from automate. I think I just assumed it was a string already when I wrote the original DateTime.parse
, and my automate methods I'm pretty sure I just used a string to set my fields.
@@ -86,7 +86,7 @@ | |||
|
|||
context "when the automate hash has a value" do | |||
context "when the value is a date format" do | |||
let(:value) { "01/02/2015" } | |||
let(:value) { Time.utc(2015, 01, 02) } |
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.
Shouldn't we test both the old string format as well as the Time object?
Checked commit d-m-u@764e1e3 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/dialog_field_date_control.rb
|
Dynamic date pickers and datetime pickers are sometimes called with time objects, not strings, and so we need to ensure they're strings before we try and feed them into DateTime.parse in the model.
normalize_automate_vals gets called with ActiveSupport::TimeWithZone.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1685266