tasks/buildWeekData.js
function formatWeekDataAsModule(weekData) {
  const date = new Date();
  const { firstDay, weekendEnd, weekendStart } = weekData;
  const transformed = {
    firstDay: transformWeekDays(firstDay),
    weekendEnd: transformWeekDays(weekendEnd),
    weekendStart: transformWeekDays(weekendStart)
  };
  const formatted = JSON.stringify(transformed, null, 2);
  const js =
`// Generated at ${date}
// from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json
const weekData = ${formatted};
export default weekData;
`;
  return js;
}
function formatWeekDataAsModule(weekData) {
  const date = new Date();
  const { firstDay, weekendEnd, weekendStart } = weekData;
  const transformed = {
    firstDay: transformWeekDays(firstDay),
    weekendEnd: transformWeekDays(weekendEnd),
    weekendStart: transformWeekDays(weekendStart)
  };
  const formatted = JSON.stringify(transformed, null, 2);
  const js =
`// Generated at ${date}
// from https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json
const weekData = ${formatted};
export default weekData;
`;
  return js;
}
function formatWeekDataAsModule ( weekData ) { const date = new Date ( ) ; const { firstDay , weekendEnd , weekendStart } = weekData ; const transformed = { firstDay : transformWeekDays ( firstDay ) , weekendEnd : transformWeekDays ( weekendEnd ) , weekendStart : transformWeekDays ( weekendStart ) } ; const formatted = JSON . stringify ( transformed , null , 2 ) ; const js = ` ${ date } ${ formatted } ` ; return js ; }
Extract the week data we care about and format it as an ES6 module.
Extract the week data we care about and format it as an ES6 module .