constructor ({maintenanceID, name, status, startAt, endAt, createdAt = new Date().toISOString(), updatedAt = new Date().toISOString()}) { super() this.maintenanceID = maintenanceID this.name = name this.status = status this.startAt = startAt this.endAt = endAt this.createdAt = createdAt this.updatedAt = updatedAt }
it('logs WARN', () => { logger.warn('<warn message>', { extra1: true }) expect(console.warn).toHaveBeenCalledWith( JSON.stringify({ level: 'WARN', timestamp: timeNow.toISOString(), logger: 'kafkajs', message: '<warn message>', extra1: true, }) ) })
function formatJobSchedule(job_schedule) { if (typeof job_schedule.startAfter === 'undefined') { job_schedule.startAfter = new Date().toISOString(); } return job_schedule; }
$export($export.P + $export.F * _dereq_(35)(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; }), 'Date', { // eslint-disable-next-line no-unused-vars toJSON: function toJSON(key) { var O = toObject(this); var pv = toPrimitive(O); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } });
function renderPost (results) { const templateStr = fs.readFileSync(path.resolve(__dirname, 'release.hbs')).toString('utf8') const template = Handlebars.compile(templateStr, { noEscape: true }) const view = Object.assign({ date: new Date().toISOString(), versionSlug: slugify(results.version) }, results) return Object.assign({ content: template(view) }, results) }
function parseDate(value) { let [parsedDate] = chrono.parse(value); if (parsedDate === undefined) { return null; } let dateMoment = parsedDateToMoment(parsedDate); return dateMoment.toISOString( // passing true here keeps the offset in the iso string rather than // convert it to UTC which is the default to align with native JS Dates true ); }
pino.pretty({ formatter: (logs, options) => { return `${options.asColoredText( { level: 10 }, `[${new Date().toISOString()}]` )} ${options.prefix.toLowerCase()} ${logs.stack ? logs.stack : logs.msg}`; }, })
const getDateTimeInfo = () => { return { now: Date.now(), iso: new Date().toISOString(), utc: new Date().toUTCString() }; }
const createMessage = num => ({ key: `key-${num}`, value: `value-${num}-${new Date().toISOString()}`, headers: { 'correlation-id': `${num}-${Date.now()}`, }, })
it('logs INFO', () => { logger.info('<info message>', { extra1: true }) expect(console.info).toHaveBeenCalledWith( JSON.stringify({ level: 'INFO', timestamp: timeNow.toISOString(), logger: 'kafkajs', message: '<info message>', extra1: true, }) ) })
t('let postgres do implicit cast of unknown types', async() => { await sql`create table test (x timestamp with time zone)` const [{ x }] = await sql`insert into test values (${ new Date().toISOString() }) returning *` return [true, x instanceof Date, await sql`drop table test`] })
function toString (value) { return typeof value === 'number' ? new Date(value).toISOString() : typeof value === 'object' ? value.toISOString() : value }
constructor ({incidentID, name, status, createdAt = new Date().toISOString(), updatedAt = new Date().toISOString()}) { super() this.incidentID = incidentID this.name = name this.status = status this.createdAt = createdAt this.updatedAt = updatedAt }
constructor ({maintenanceID, maintenanceUpdateID, maintenanceStatus, message = '', createdAt = new Date().toISOString(), updatedAt = new Date().toISOString()}) { super() this.maintenanceID = maintenanceID this.maintenanceUpdateID = maintenanceUpdateID this.maintenanceStatus = maintenanceStatus this.message = message this.createdAt = createdAt this.updatedAt = updatedAt }
constructor ({maintenanceID, maintenanceUpdateID, maintenanceStatus, message = '', createdAt = new Date().toISOString(), updatedAt = new Date().toISOString()}) { super() this.maintenanceID = maintenanceID this.maintenanceUpdateID = maintenanceUpdateID this.maintenanceStatus = maintenanceStatus this.message = message this.createdAt = createdAt this.updatedAt = updatedAt }