railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.87k stars 2.25k forks source link

Add support for '%-l' option to Flatpickr. #3616

Closed gguerini closed 1 year ago

gguerini commented 1 year ago

We currently support the options %-d, %-H, %-I, %-M, %-m, %-S, but not %-l. Adding %-l will prevent an error to be raised when the Ruby format uses this option.

Here's an example of how this could be used:

> datetime = DateTime.new(2023, 4, 6, 9, 15)
=> Thu, 06 Apr 2023 09:15:00 +0000
> datetime.strftime("at %-l:%M %p")
=> "at 9:15 AM" # no extra pad before the hour
> datetime.strftime("at %l:%M %p")
=> "at  9:15 AM" # extra pad before the hour
coveralls commented 1 year ago

Coverage Status

Coverage: 95.814%. Remained the same when pulling 14e4357f803e7512c1f5a0bff7301ba554e80527 on gguerini:gg-add-support-for-not-padded-hour-of-day-flatpickr into 5a958e46e8620fba320e04347d326d058c07d396 on railsadminteam:master.

mshibuya commented 1 year ago

Thank you!