Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -57,8 +57,9 @@ const transPublishingTopicAndMessage = async(bottleId) => { | ... | @@ -57,8 +57,9 @@ const transPublishingTopicAndMessage = async(bottleId) => { |
57 | 57 | ||
58 | const bottle = await Bottle.findByBottleId(bottleId); | 58 | const bottle = await Bottle.findByBottleId(bottleId); |
59 | const recentOpen = bottle.getRecentOpenDate(); | 59 | const recentOpen = bottle.getRecentOpenDate(); |
60 | + const dosage = bottle.getDosage(); | ||
60 | 61 | ||
61 | - const message = 'res/' + await transDate(recentOpen); | 62 | + const message = 'res/' + await transDate(recentOpen) + '/' + dosage; |
62 | 63 | ||
63 | return { | 64 | return { |
64 | topic, | 65 | topic, |
... | @@ -66,9 +67,8 @@ const transPublishingTopicAndMessage = async(bottleId) => { | ... | @@ -66,9 +67,8 @@ const transPublishingTopicAndMessage = async(bottleId) => { |
66 | }; | 67 | }; |
67 | } | 68 | } |
68 | 69 | ||
69 | -//날짜를 yymmdd로 변환해주는 함수 | 70 | +//날짜를 mmdd로 변환해주는 함수 |
70 | const transDate = (date) => { | 71 | const transDate = (date) => { |
71 | - return String(date.getFullYear()).substr(2, 2) | 72 | + return (date.getMonth() + 1 < 10 ? '0' + String(date.getMonth() + 1) : String(date.getMonth() + 1)) |
72 | - + (date.getMonth() + 1 < 10 ? '0' + String(date.getMonth() + 1) : String(date.getMonth() + 1)) | ||
73 | + (date.getDate() < 10 ? '0' + String(date.getDate()) : String(date.getDate())); | 73 | + (date.getDate() < 10 ? '0' + String(date.getDate()) : String(date.getDate())); |
74 | } | 74 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment