Skip to content

Commit 3a557b6

Browse files
committed
Localize AM and PM strings
1 parent d214d65 commit 3a557b6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Changelog
22
=========
3+
## 3.0.3
4+
* Localize AM and PM strings
5+
36
## 3.0.2
47
* Fixes typescript typings not being exposed publicly
58

src/datetime/TimeView.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ export default class TimeView extends React.Component {
8686
}
8787
}
8888

89-
if ( type === 'ampm' && this.props.timeFormat.indexOf(' A') !== -1 ) {
90-
value = value.toUpperCase();
89+
if ( type === 'ampm' ) {
90+
if ( this.props.timeFormat.indexOf(' A') !== -1 ) {
91+
value = this.props.viewDate.format('A');
92+
}
93+
else {
94+
value = this.props.viewDate.format('a');
95+
}
9196
}
9297

9398
return (

0 commit comments

Comments
 (0)