mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 10:07:33 +02:00
refactor(docs,blog): last update timestamp should be in milliseconds instead of seconds (#9963)
This commit is contained in:
parent
6c724ed857
commit
465cf4d82c
8 changed files with 35 additions and 29 deletions
|
@ -8,7 +8,12 @@
|
|||
import {jest} from '@jest/globals';
|
||||
import path from 'path';
|
||||
import {loadContext} from '@docusaurus/core/src/server/site';
|
||||
import {createSlugger, posixPath, DEFAULT_PLUGIN_ID} from '@docusaurus/utils';
|
||||
import {
|
||||
createSlugger,
|
||||
posixPath,
|
||||
DEFAULT_PLUGIN_ID,
|
||||
GIT_FALLBACK_LAST_UPDATE_DATE,
|
||||
} from '@docusaurus/utils';
|
||||
import {createSidebarsUtils} from '../sidebars/utils';
|
||||
import {
|
||||
processDocMetadata,
|
||||
|
@ -474,7 +479,7 @@ describe('simple site', () => {
|
|||
custom_edit_url: 'https://github.com/customUrl/docs/lorem.md',
|
||||
unrelated_front_matter: "won't be part of metadata",
|
||||
},
|
||||
lastUpdatedAt: 1539502055,
|
||||
lastUpdatedAt: GIT_FALLBACK_LAST_UPDATE_DATE,
|
||||
lastUpdatedBy: 'Author',
|
||||
tags: [],
|
||||
unlisted: false,
|
||||
|
@ -571,7 +576,7 @@ describe('simple site', () => {
|
|||
},
|
||||
title: 'Custom Last Update',
|
||||
},
|
||||
lastUpdatedAt: new Date('1/1/2000').getTime() / 1000,
|
||||
lastUpdatedAt: new Date('1/1/2000').getTime(),
|
||||
lastUpdatedBy: 'Custom Author (processed by parseFrontMatter)',
|
||||
sidebarPosition: undefined,
|
||||
tags: [],
|
||||
|
@ -609,7 +614,7 @@ describe('simple site', () => {
|
|||
},
|
||||
title: 'Last Update Author Only',
|
||||
},
|
||||
lastUpdatedAt: 1539502055,
|
||||
lastUpdatedAt: GIT_FALLBACK_LAST_UPDATE_DATE,
|
||||
lastUpdatedBy: 'Custom Author (processed by parseFrontMatter)',
|
||||
sidebarPosition: undefined,
|
||||
tags: [],
|
||||
|
@ -647,7 +652,7 @@ describe('simple site', () => {
|
|||
},
|
||||
title: 'Last Update Date Only',
|
||||
},
|
||||
lastUpdatedAt: new Date('1/1/2000').getTime() / 1000,
|
||||
lastUpdatedAt: new Date('1/1/2000').getTime(),
|
||||
lastUpdatedBy: 'Author',
|
||||
sidebarPosition: undefined,
|
||||
tags: [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue