Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
fix(historical-data): fix date-fns day format
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Sep 9, 2019
1 parent 7236b7e commit 0d6bdda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions historicalData/concatenateRawDeviceMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,22 @@ export const handler = async () => {
// Concatenate hours
await concatenateFiles({
Prefix: 'raw/updates/',
notAfterDate: dateFns.format(new Date(), "yyyy-MM-DD'T'HH"),
notAfterDate: dateFns.format(new Date(), "yyyy-MM-dd'T'HH"),
fileNameToDate: filename => {
const [date] = path.parse(filename).name.split('-')
const m = dateRx.exec(date)
if (m) {
const [, year, month, day, hour] = m
return `${year}-${month}-${day}T${hour}`
}
return dateFns.format(new Date(), "yyyy-MM-DD'T'HH") // No date found
return dateFns.format(new Date(), "yyyy-MM-dd'T'HH") // No date found
},
dateToFileName: date => `hours/${date}.txt`,
})
// Concatenate days
await concatenateFiles({
Prefix: 'hours/',
notAfterDate: dateFns.format(new Date(), 'yyyy-MM-DD'),
notAfterDate: dateFns.format(new Date(), 'yyyy-MM-dd'),
fileNameToDate: filename => {
const [year, month, day] = path
.parse(filename)
Expand Down

0 comments on commit 0d6bdda

Please sign in to comment.