Skip to content

Commit 920cbcc

Browse files
committed
Merge pull request #2540 from ivanzotov/master
Fix momentjs translations for '%-d' format day of the month
2 parents 1c1218f + fb52621 commit 920cbcc

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

lib/rails_admin/support/datetime.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Datetime
1010
'%b' => 'MMM', # The abbreviated month name ("Jan")
1111
'%B' => 'MMMM', # The full month name ("January")
1212
'%d' => 'DD', # Day of the month (01..31)
13+
'%-d' => 'D', # Day of the month (1..31)
1314
'%D' => 'MM/DD/YY', # American date format mm/dd/yy
1415
'%e' => 'D', # Day of the month (1..31)
1516
'%F' => 'YY-MM-DD', # ISO 8601 date format

spec/rails_admin/support/datetime_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
'%D de %M de %Y, %H:%M:%S' => 'MM/DD/YY [de] mm [de] YYYY, HH:mm:ss',
99
'%d/%-m/%Y, %H:%M:%S' => 'DD/M/YYYY, HH:mm:ss',
1010
'%d de %B de %Y' => 'DD [de] MMMM [de] YYYY',
11+
'%-d %B %Y' => 'D MMMM YYYY',
1112
}.each do |strftime_format, momentjs_format|
1213
it "convert strftime_format to momentjs_format - example #{strftime_format}" do
1314
strftime_format = RailsAdmin::Support::Datetime.new(strftime_format)

0 commit comments

Comments
 (0)