tools/gulp-tasks/cldr/extract.js
function getDayPeriods(localeData, dayPeriodsList) {
  const dayPeriods = localeData.main(`dates/calendars/gregorian/dayPeriods`);
  const result = {};
  // cleaning up unused keys
  Object.keys(dayPeriods).forEach(key1 => {          // format / stand-alone
    result[key1] = {};
    Object.keys(dayPeriods[key1]).forEach(key2 => {  // narrow / abbreviated / wide
      result[key1][key2] = {};
      Object.keys(dayPeriods[key1][key2]).forEach(key3 => {
        if (dayPeriodsList.indexOf(key3) !== -1) {
          result[key1][key2][key3] = dayPeriods[key1][key2][key3];
        }
      });
    });
  });

  return result;
}
function getDayPeriods(localeData, dayPeriodsList) {
  const dayPeriods = localeData.main(`dates/calendars/gregorian/dayPeriods`);
  const result = {};
  // cleaning up unused keys
  Object.keys(dayPeriods).forEach(key1 => {          // format / stand-alone
    result[key1] = {};
    Object.keys(dayPeriods[key1]).forEach(key2 => {  // narrow / abbreviated / wide
      result[key1][key2] = {};
      Object.keys(dayPeriods[key1][key2]).forEach(key3 => {
        if (dayPeriodsList.indexOf(key3) !== -1) {
          result[key1][key2][key3] = dayPeriods[key1][key2][key3];
        }
      });
    });
  });

  return result;
}
function getDayPeriods ( localeData , dayPeriodsList ) { const dayPeriods = localeData . main ( ` ` ) ; const result = { } ; // cleaning up unused keys Object . keys ( dayPeriods ) . forEach ( key1 => { // format / stand-alone result [ key1 ] = { } ; Object . keys ( dayPeriods [ key1 ] ) . forEach ( key2 => { // narrow / abbreviated / wide result [ key1 ] [ key2 ] = { } ; Object . keys ( dayPeriods [ key1 ] [ key2 ] ) . forEach ( key3 => { if ( dayPeriodsList . indexOf ( key3 ) !== - 1 ) { result [ key1 ] [ key2 ] [ key3 ] = dayPeriods [ key1 ] [ key2 ] [ key3 ] ; } } ) ; } ) ; } ) ; return result ; }
Returns data for the chosen day periods
@returns {format: {narrow / abbreviated / wide: [...]}, stand-alone: {narrow / abbreviated / wide: [...]}}
Returns data for the chosen day periods