useEffect(() => { if (orders) { let temp = []; orders.tablePivot().map((item) => { temp.push([ parseInt(moment(item['Orders.createdAt']).format('x')), parseInt(item['Orders.count']), ]); }); setOrdersData(temp); } }, [orders]);
private writeLog(logMethod: string, logData: LogData) { logData = logData || { message: '', data: {} }; (logData as any).timeLocal = moment().format('YYYY-MM-DD HH:mm:ss.SSS'); logger[logMethod](logData); }
arr.map(function (obj) { return { title:obj.title, content:obj.content, updatedAt:moment(obj.updatedAt).format("YYYY-MM-DD HH:mm:ss"), creator:obj.creator } })
SystemNotifySchema.path('date').get(function (v) { return moment(v).format("YYYY-MM-DD HH:mm:ss"); });
function log(text) { if(typeof(text)=="object") { text=JSON.stringify(text).replace(/\s/g," "); } root.output+="["+moment().format("YYYY-MM-DD HH:mm:ss")+"]"+text+"<br>"; }
async function createPostFiles(posts) { for (const post of posts) { const filename = `${moment(post.published_at).format('YYYYMMDD-HHmmss')}.md`; await createPostFile(post, `${blogDir}/${filename}`); } }
ContentSchema.path('date').get(function (v) { return moment(v).format("YYYY-MM-DD HH:mm:ss"); });
const formatTime = (time: Date | string | number, formatStr: string): string => { return moment(time).format(formatStr); }
function dateTrans(date) { return moment(date).format("YYYY-MM-DD HH:mm:ss"); }
AnnounceSchema.path('date').get(function (v) { return moment(v).format("YYYY-MM-DD HH:mm:ss"); });
AdsSchema.path('date').get(function (v) { return moment(v).format("YYYY-MM-DD HH:mm:ss"); });
MailDeliverySchema.path('createTime').get(function (v) { return moment(v).format("YYYY-MM-DD HH:mm:ss"); });
MailTemplateSchema.path('createTime').get(function (v) { return moment(v).format("YYYY-MM-DD HH:mm:ss"); });