박권수

feat. moment timezone : seoul

...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
19 "dependencies": { 19 "dependencies": {
20 "@koa/cors": "^3.1.0", 20 "@koa/cors": "^3.1.0",
21 "moment": "^2.29.1", 21 "moment": "^2.29.1",
22 + "moment-timezone": "^0.5.33",
22 "mqtt": "^4.2.6", 23 "mqtt": "^4.2.6",
23 "node-cron": "^3.0.0" 24 "node-cron": "^3.0.0"
24 }, 25 },
......
1 const mongoose = require('mongoose'); 1 const mongoose = require('mongoose');
2 const moment = require('moment'); 2 const moment = require('moment');
3 +require('moment-timezone');
3 4
4 const Schema = mongoose.Schema; 5 const Schema = mongoose.Schema;
5 6
...@@ -35,9 +36,9 @@ PatientInfoSchema.methods.setUseYn = function(useYn) { ...@@ -35,9 +36,9 @@ PatientInfoSchema.methods.setUseYn = function(useYn) {
35 }; 36 };
36 37
37 PatientInfoSchema.methods.updateInfo = function(info) { 38 PatientInfoSchema.methods.updateInfo = function(info) {
38 - const date = moment(new Date()).format('YYYY-MM-DD hh:mm'); 39 + const date = moment.tz('Asia/Seoul').format('YYYY-MM-DD HH:mm');
39 if(this.info.length) 40 if(this.info.length)
40 - this.info = this.info.concat('\n\n', `${date} ${info}`); 41 + this.info = this.info.concat('\n\n', `${date} -> ${info}`);
41 else 42 else
42 this.info = `${date}${info}`; 43 this.info = `${date}${info}`;
43 }; 44 };
......
...@@ -725,7 +725,7 @@ minimist@^1.1.0, minimist@^1.2.5: ...@@ -725,7 +725,7 @@ minimist@^1.1.0, minimist@^1.2.5:
725 resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" 725 resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
726 integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== 726 integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
727 727
728 -moment-timezone@^0.5.31: 728 +moment-timezone@^0.5.31, moment-timezone@^0.5.33:
729 version "0.5.33" 729 version "0.5.33"
730 resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c" 730 resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c"
731 integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w== 731 integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==
......