Skip to content

Commit

Permalink
Localize DateTimeDrop Component (grommet#1736)
Browse files Browse the repository at this point in the history
* add locale to DateTime weekdays

* add locale to DateTime weekdays

* fixed quotes style

* fixed quotes style
  • Loading branch information
przytrzask authored and alansouzati committed Nov 27, 2017
1 parent b5c4ab0 commit 68fb633
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/js/components/DateTimeDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ import CSSClassnames from '../utils/CSSClassnames';
import { announce } from '../utils/Announcer';
import Intl from '../utils/Intl';
import KeyboardAccelerators from '../utils/KeyboardAccelerators';
import { getCurrentLocale } from '../utils/Locale';

const CLASS_ROOT = CSSClassnames.DATE_TIME_DROP;
const WEEK_DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const locale = getCurrentLocale();
moment.locale(locale);
const WEEK_DAYS = moment.weekdaysShort(true) || [
'Sun',
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat'
];
// const DATE_REGEXP = new RegExp('[DMY]');
const DAY_REGEXP = new RegExp('[D]');
const MONTHYEAR_REGEXP = new RegExp('[MY]');
Expand Down

0 comments on commit 68fb633

Please sign in to comment.