Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('getTicks()', function() {
const ticks = scale.getTicks();
expect(typeof ticks[0]).to.be.equal('object');
expect(ticks[1].value).to.be.equal(0.5);
expect(ticks[1].text).to.be.equal(fecha.format(1442937600000, mask));
});
return val => {
if (typeof val === 'string') return val;
if (typeof val === "number") val = new Date(val);
return fecha.format(val, format);
}
}
formatToDayTime(date = new Date()) {
return fecha.format(date, 'YYYY-MM-DD HH:mm:ss');
},
formatDayStrToDayTimeStr(dateStr) {
function formatDate(
viewLayoutOptions, { cellData, columnData, columnIndex, dataKey, isScrolling, rowData, rowIndex }
) {
if (cellData) {
const { dateTimePattern } = viewLayoutOptions;
return fecha.format(new Date().setTime(cellData), dateTimePattern);
}
return '';
}
renderItem={({ item: order }) => (
)}
/>
time(
value: Date | string | number,
outputFormat: ?string = null,
inputFormat: string = "Y-m-dTH:i:sO"
): string {
if (!outputFormat) {
outputFormat = this.getTimeFormat();
}
if (!(value instanceof Date)) {
value = fecha.parse(value, inputFormat);
}
return fecha.format(value, outputFormat);
}
process.stdout.write = function (string, encoding) {
if(isDebug) {
string = `${fecha.format(new Date(), "HH:mm:ss.SSS")}: ${string}`;
stdoutFile.write(string, encoding);
}
};
const Meta = props => {
const date = fecha.format(new Date(props.date), 'shortDate');
const author = props.authorData.find(author => author.id === props.author);
return (
<p>
{author && `By ${author.name}`} on {date}
</p>
);
};
return [msg(messages.invalidDate)];
}
let err = [];
if (!isNil(field.min)) {
let min = new Date(field.min);
if (m.valueOf() < min.valueOf()) {
err.push(msg(messages.dateIsEarly, fecha.format(m), fecha.format(min)));
}
}
if (!isNil(field.max)) {
let max = new Date(field.max);
if (m.valueOf() > max.valueOf()) {
err.push(msg(messages.dateIsLate, fecha.format(m), fecha.format(max)));
}
}
return err;
},
getText(value) {
const formatter = this.formatter;
value = this.translate(value);
value = formatter ? formatter(value) : fecha.format(value, this.mask);
return value;
}