박권수

feat. moment timezone : seoul

......@@ -19,6 +19,7 @@
"dependencies": {
"@koa/cors": "^3.1.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"mqtt": "^4.2.6",
"node-cron": "^3.0.0"
},
......
const mongoose = require('mongoose');
const moment = require('moment');
require('moment-timezone');
const Schema = mongoose.Schema;
......@@ -35,9 +36,9 @@ PatientInfoSchema.methods.setUseYn = function(useYn) {
};
PatientInfoSchema.methods.updateInfo = function(info) {
const date = moment(new Date()).format('YYYY-MM-DD hh:mm');
const date = moment.tz('Asia/Seoul').format('YYYY-MM-DD HH:mm');
if(this.info.length)
this.info = this.info.concat('\n\n', `${date} ${info}`);
this.info = this.info.concat('\n\n', `${date} -> ${info}`);
else
this.info = `${date}${info}`;
};
......
......@@ -725,7 +725,7 @@ minimist@^1.1.0, minimist@^1.2.5:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
moment-timezone@^0.5.31:
moment-timezone@^0.5.31, moment-timezone@^0.5.33:
version "0.5.33"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c"
integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==
......