Skip to content

Commit

Permalink
Merge pull request #2540 from ivanzotov/master
Browse files Browse the repository at this point in the history
Fix momentjs translations for '%-d' format day of the month
  • Loading branch information
mshibuya committed Jan 30, 2016
2 parents 1c1218f + fb52621 commit 920cbcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rails_admin/support/datetime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Datetime
'%b' => 'MMM', # The abbreviated month name ("Jan")
'%B' => 'MMMM', # The full month name ("January")
'%d' => 'DD', # Day of the month (01..31)
'%-d' => 'D', # Day of the month (1..31)
'%D' => 'MM/DD/YY', # American date format mm/dd/yy
'%e' => 'D', # Day of the month (1..31)
'%F' => 'YY-MM-DD', # ISO 8601 date format
Expand Down
1 change: 1 addition & 0 deletions spec/rails_admin/support/datetime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'%D de %M de %Y, %H:%M:%S' => 'MM/DD/YY [de] mm [de] YYYY, HH:mm:ss',
'%d/%-m/%Y, %H:%M:%S' => 'DD/M/YYYY, HH:mm:ss',
'%d de %B de %Y' => 'DD [de] MMMM [de] YYYY',
'%-d %B %Y' => 'D MMMM YYYY',
}.each do |strftime_format, momentjs_format|
it "convert strftime_format to momentjs_format - example #{strftime_format}" do
strftime_format = RailsAdmin::Support::Datetime.new(strftime_format)
Expand Down

0 comments on commit 920cbcc

Please sign in to comment.