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

No support for midnight with :time type #188

Open
bbugh opened this issue May 19, 2020 · 1 comment
Open

No support for midnight with :time type #188

bbugh opened this issue May 19, 2020 · 1 comment

Comments

@bbugh
Copy link

bbugh commented May 19, 2020

When setting 24:00, the gem seems to wrap the expected value to 0, so there seems to be no way to say "before midnight".

validates :w_day_begin, timeliness: { before: '24:00' }
                                                           vvvvvvvv wrap to zero?
 @details={:w_day_begin=>[{:error=>:before, :restriction=>"00:00:00"}]},
 @messages={:w_day_begin=>["before error message"]}>
@sherif-nedap
Copy link

@bbugh this is old :), but i just had the same issue,

i have the same issue:

start_time: 23:00
end_time: 24:00

this will trigger this validation to raise exception because 24:00 will be converted to 00:00

validates_time :end_time,
                       after: :start_time, after_message: _('End time should be after start time'),
                       if: :start_time

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

No branches or pull requests

2 participants