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

Function timeUnitSpecifier

docs/app/js/sanddance-app.js:111213–111225  ·  view source on GitHub ↗
(units, specifiers)

Source from the content-addressed store, hash-verified

111211 ["".concat(HOURS, "-").concat(MINUTES)]: "%H:%M"
111212};
111213function timeUnitSpecifier(units, specifiers) {
111214 const s = (0, _vegaUtil.extend)({}, defaultSpecifiers, specifiers), u = timeUnits(units), n = u.length;
111215 let fmt = "", start = 0, end, key;
111216 for(start = 0; start < n;)for(end = u.length; end > start; --end){
111217 key = u.slice(start, end).join("-");
111218 if (s[key] != null) {
111219 fmt += s[key];
111220 start = end;
111221 break;
111222 }
111223 }
111224 return fmt.trim();
111225}
111226const t0 = new Date();
111227function localYear(y) {
111228 t0.setFullYear(y);

Callers

nothing calls this directly

Calls 1

timeUnitsFunction · 0.70

Tested by

no test coverage detected