getHours() is local time, use getUTCHours()
This commit is contained in:
parent
77ee3b4ad6
commit
44676ea947
|
@ -27,7 +27,7 @@ function convertAtomItemToMd(item, opts) {
|
|||
source: "${item.url}"
|
||||
context: "${item.context}"
|
||||
title: "${item.title}"
|
||||
date: "${item.year}-${item.month}-${item.day}T${strpad(item.date.getHours())}:${strpad(item.date.getMinutes())}:${strpad(item.date.getSeconds())}"
|
||||
date: "${item.year}-${item.month}-${item.day}T${strpad(item.date.getUTCHours())}:${strpad(item.date.getMinutes())}:${strpad(item.date.getSeconds())}"
|
||||
---
|
||||
|
||||
${item.content}
|
||||
|
@ -69,7 +69,7 @@ async function parseMastoFeed(opts) {
|
|||
url: item.id, // format: https://chat.brainbaking.com/objects/0707fd54-185d-4ee7-9204-be370d57663c
|
||||
context,
|
||||
id: stripBeforeLastSlash(item.id),
|
||||
hash: `${day}h${date.getHours()}m${date.getMinutes()}s${date.getSeconds()}`,
|
||||
hash: `${day}h${date.getUTCHours()}m${date.getMinutes()}s${date.getSeconds()}`,
|
||||
date, // format: 2021-03-02T16:18:46.658056Z
|
||||
year,
|
||||
month,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
source: "https://chat.brainbaking.com/objects/77a3ecfb-47e1-4d7a-a24a-8b779d80a8ac"
|
||||
context: ""
|
||||
title: "I pulled the Google plug and installed LineageOS: https://brainbaking.com/post/2021/03/getting-ri..."
|
||||
date: "2021-03-01T20:03:35"
|
||||
date: "2021-03-01T19:03:35"
|
||||
---
|
||||
|
||||
I pulled the Google plug and installed LineageOS: <a href="https://brainbaking.com/post/2021/03/getting-rid-of-tracking-using-lineageos/" rel="ugc">https://brainbaking.com/post/2021/03/getting-rid-of-tracking-using-lineageos/</a> Very impressed so far! Also rely on my own CalDAV server to replace GCalendar. Any others here running <a class="hashtag" data-tag="lineageos" href="https://chat.brainbaking.com/tag/lineageos" rel="tag ugc">#lineageos</a> for privacy reasons?
|
|
@ -26,7 +26,6 @@ describe("mastodon feed parser tests", () => {
|
|||
let dir = await fsp.readdir(`${dumpdir}/2021/02`, { withFileTypes: true })
|
||||
expect(dir.length).toBe(8)
|
||||
dir = await fsp.readdir(`${dumpdir}/2021/03`, { withFileTypes: true })
|
||||
console.log(dir)
|
||||
expect(dir.length).toBe(4)
|
||||
})
|
||||
|
||||
|
@ -36,8 +35,8 @@ describe("mastodon feed parser tests", () => {
|
|||
notesdir: dumpdir
|
||||
})
|
||||
|
||||
const actualMd = await fsp.readFile(`${dumpdir}/2021/03/01h20m3s35.md`).toString()
|
||||
const expectedMd = await fsp.readFile(`${__dirname}/expected-01h20m3s35.md`).toString()
|
||||
const actualMd = await fsp.readFile(`${dumpdir}/2021/03/01h19m3s35.md`).toString()
|
||||
const expectedMd = await fsp.readFile(`${__dirname}/expected-01h19m3s35.md`).toString()
|
||||
|
||||
expect(actualMd).toEqual(expectedMd)
|
||||
})
|
||||
|
@ -49,7 +48,7 @@ describe("mastodon feed parser tests", () => {
|
|||
notesdir: dumpdir
|
||||
})
|
||||
|
||||
const actualMd = await fsp.readFile(`${dumpdir}/2021/03/02h17m18s46.md`)
|
||||
const actualMd = await fsp.readFile(`${dumpdir}/2021/03/02h16m18s46.md`)
|
||||
const expectedReplyTo = "https://social.linux.pizza/users/StampedingLonghorn/statuses/105821099684887793"
|
||||
|
||||
const md = frontMatterParser.parseSync(actualMd.toString())
|
||||
|
|
Loading…
Reference in New Issue