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 }
function formatJobSchedule(job_schedule) { if (typeof job_schedule.startAfter === 'undefined') { job_schedule.startAfter = new Date().toISOString(); } return job_schedule; }
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) }
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()}`, }, })
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 }
constructor ({incidentID, incidentUpdateID, incidentStatus, message = '', createdAt = new Date().toISOString(), updatedAt = new Date().toISOString()}) { super() this.incidentID = incidentID this.incidentUpdateID = incidentUpdateID this.incidentStatus = incidentStatus this.message = message this.createdAt = createdAt this.updatedAt = updatedAt }
pino.pretty({ formatter: (logs, options) => { return `${options.asColoredText( { level: 10 }, `[${new Date().toISOString()}]` )} ${options.prefix.toLowerCase()} ${logs.stack ? logs.stack : logs.msg}`; }, })
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 }
function toString (value) { return typeof value === 'number' ? new Date(value).toISOString() : typeof value === 'object' ? value.toISOString() : value }