Skip to content

Commit

Permalink
Fix am / pm i18n's bug (#22963)
Browse files Browse the repository at this point in the history
  • Loading branch information
miminari authored Jun 20, 2020
1 parent b831891 commit 5e0b80a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/date-time/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TimePicker extends Component {
year: '',
hours: '',
minutes: '',
am: true,
am: '',
date: null,
};
this.changeDate = this.changeDate.bind( this );
Expand Down Expand Up @@ -89,7 +89,7 @@ class TimePicker extends Component {
const month = selected.format( 'MM' );
const year = selected.format( 'YYYY' );
const minutes = selected.format( 'mm' );
const am = selected.format( 'A' );
const am = selected.format( 'H' ) <= 11 ? 'AM' : 'PM';
const hours = selected.format( is12Hour ? 'hh' : 'HH' );
const date = currentTime ? moment( currentTime ) : moment();
this.setState( { day, month, year, minutes, hours, am, date } );
Expand Down

0 comments on commit 5e0b80a

Please sign in to comment.