MCPcopy Create free account
hub / github.com/microsoft/SandDance / timeLocale

Function timeLocale

docs/app/js/sanddance-app.js:110046–110054  ·  view source on GitHub ↗
(locale2)

Source from the content-addressed store, hash-verified

110044 return (date)=>(second(date) < date ? L : minute(date) < date ? S : hour(date) < date ? M : day(date) < date ? H : month(date) < date ? week(date) < date ? d : w : year(date) < date ? quarter(date) < date ? m : q : y)(date);
110045}
110046function timeLocale(locale2) {
110047 const timeFormat = memoize(locale2.format), utcFormat = memoize(locale2.utcFormat);
110048 return {
110049 timeFormat: (spec)=>(0, _vegaUtil.isString)(spec) ? timeFormat(spec) : timeMultiFormat(timeFormat, (0, _vegaTime.timeInterval), spec),
110050 utcFormat: (spec)=>(0, _vegaUtil.isString)(spec) ? utcFormat(spec) : timeMultiFormat(utcFormat, (0, _vegaTime.utcInterval), spec),
110051 timeParse: memoize(locale2.parse),
110052 utcParse: memoize(locale2.utcParse)
110053 };
110054}
110055let defaultTimeLocale;
110056resetTimeFormatDefaultLocale();
110057function resetTimeFormatDefaultLocale() {

Callers 2

timeFormatLocaleFunction · 0.70

Calls 4

timeFormatFunction · 0.85
utcFormatFunction · 0.85
memoizeFunction · 0.70
timeMultiFormatFunction · 0.70

Tested by

no test coverage detected