Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// ----------------------------------------------------------------------
// local time -----------------------------------------------------------
formatFn = d3TimeFormat.timeFormat('.%L');
parseFn = d3TimeFormat.timeParse('.%L');
// utc ------------------------------------------------------------------
formatFn = d3TimeFormat.utcFormat('.%L');
parseFn = d3TimeFormat.utcParse('.%L');
// iso ------------------------------------------------------------------
let dateString: string = d3TimeFormat.isoFormat(new Date(2016, 6, 6));
let date: Date = d3TimeFormat.isoParse('2016-07-08T14:06:41.386Z');
// ----------------------------------------------------------------------
// Test Locale Definition
// ----------------------------------------------------------------------
let dateTimeSpecifier: string = localeDef.dateTime;
let dateSpecifier: string = localeDef.date;
let timeSpecifier: string = localeDef.time;
let periods: [string, string] = localeDef.periods;
let days: [string, string, string, string, string, string, string] = localeDef.days;
let shortDays: [string, string, string, string, string, string, string] = localeDef.shortDays;
let months: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.months;
let shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.shortMonths;
localeDef = {
dateTime: '%a %b %e %X %Y',
// ----------------------------------------------------------------------
// local time -----------------------------------------------------------
formatFn = d3TimeFormat.timeFormat('.%L');
parseFn = d3TimeFormat.timeParse('.%L');
// utc ------------------------------------------------------------------
formatFn = d3TimeFormat.utcFormat('.%L');
parseFn = d3TimeFormat.utcParse('.%L');
// iso ------------------------------------------------------------------
let dateString: string = d3TimeFormat.isoFormat(new Date(2016, 6, 6));
let date: Date = d3TimeFormat.isoParse('2016-07-08T14:06:41.386Z');
// ----------------------------------------------------------------------
// Test Locale Definition
// ----------------------------------------------------------------------
let dateTimeSpecifier: string = localeDef.dateTime;
let dateSpecifier: string = localeDef.date;
let timeSpecifier: string = localeDef.time;
let periods: [string, string] = localeDef.periods;
let days: [string, string, string, string, string, string, string] = localeDef.days;
let shortDays: [string, string, string, string, string, string, string] = localeDef.shortDays;
let months: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.months;
let shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.shortMonths;
localeDef = {
dateTime: '%a %b %e %X %Y',
return counters.map(counter => {
return assign({}, counter, { start_time: d3TimeFormat.isoParse(counter.start_time) });
});
}),
return data.map(({ [horizontalKey]: x, [verticalKey]: y }) => {
return { [horizontalKey]: isoParse(x), [verticalKey]: y };
});
}
return counters.map(counter => {
return assign({}, counter, { start_time: d3TimeFormat.isoParse(counter.start_time) });
});
}),
return counters.map((counter, index) => {
return assign({}, counter, {
start_time: d3TimeFormat.isoParse(counter.start_time),
fill_color: index === counters.length - 1 ? UI_GRAY_300 : UI_GRAY_100,
});
});
}),