Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
i18n: function () {
// Filters used to extract the order of pickers from the ilib template
const includeMeridiem = /([khma])(?!\1)/ig;
const excludeMeridiem = /([khm])(?!\1)/ig;
// Label formatter
const formatter = new DateFmt({
type: 'time',
useNative: false,
timezone: 'local',
length: 'full',
date: 'dmwy'
});
// Meridiem localization
const merFormatter = new DateFmt({
template: 'a',
useNative: false,
timezone: 'local'
});
const meridiems = merFormatter.getMeridiemsRange();
const meridiemRanges = meridiems.map(calcMeridiemRange);
const meridiemLabels = meridiems.map(obj => obj.name);
// Picker ordering
const li = new LocaleInfo();
const clockPref = li.getClock();
const meridiemEnabled = clockPref === '12';
const filter = meridiemEnabled ? includeMeridiem : excludeMeridiem;
const order = formatter.getTemplate()
.replace(/'.*?'/g, '')
i18n: function () {
// Filters used to extract the order of pickers from the ilib template
const includeMeridiem = /([khma])(?!\1)/ig;
const excludeMeridiem = /([khm])(?!\1)/ig;
// Label formatter
const formatter = new DateFmt({
type: 'time',
useNative: false,
timezone: 'local',
length: 'full',
date: 'dmwy'
});
// Meridiem localization
const merFormatter = new DateFmt({
template: 'a',
useNative: false,
timezone: 'local'
});
const meridiems = merFormatter.getMeridiemsRange();
const meridiemRanges = meridiems.map(calcMeridiemRange);
const meridiemLabels = meridiems.map(obj => obj.name);
i18n: function () {
const formatter = new DateFmt({
date: 'dmwy',
length: 'full',
timezone: 'local',
useNative: false
});
const order = formatter.getTemplate()
.replace(/'.*?'/g, '')
.match(/([mdy]+)/ig)
.map(s => s[0].toLowerCase());
/*
* Converts a gregorian year to local year
*
* @param {Number} year gregorian year
*