Skip to content
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

DateField and DateTimeField - Accept inputs that behave like Date #969

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

jkotests
Copy link
Member

Setting a DateField or DateTimeField currently requires a String, Date or Time. This can be too strict.

For example, it prevents using ActiveSupport with time zones:

require 'active_support/time'

Time.zone = 'Stockholm'
browser.date_field.set(2.months.ago)
#=> ArgumentError (DateField#set only accepts instances of Date or Time)

This PR proposes accepting any object that responds to #strftime.

Copy link
Member

@titusfortner titusfortner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Thanks.

@titusfortner titusfortner merged commit fa4c685 into watir:main Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants