|
|
@@ -14,7 +14,6 @@ import {
|
|
|
const { isTrashPage: _isTrashPage } = pagePathUtils;
|
|
|
|
|
|
const jsonNull = 'null';
|
|
|
-const dateNull = 'null';
|
|
|
|
|
|
const ContextExtractorOnce: FC = () => {
|
|
|
|
|
|
@@ -32,7 +31,16 @@ const ContextExtractorOnce: FC = () => {
|
|
|
const path = decodeURI(mainContent?.getAttribute('data-path') || '');
|
|
|
const pageId = mainContent?.getAttribute('data-page-id') || null;
|
|
|
const revisionCreatedAt = +(mainContent?.getAttribute('data-page-revision-created') || '');
|
|
|
- const createdAt = new Date(mainContent?.getAttribute('data-page-created-at') || dateNull);
|
|
|
+
|
|
|
+ let createdAt: Date | null;
|
|
|
+ const createdAtAttribute = mainContent?.getAttribute('data-page-created-at');
|
|
|
+ if (createdAtAttribute != null) {
|
|
|
+ createdAt = new Date(createdAtAttribute);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ createdAt = null;
|
|
|
+ }
|
|
|
+
|
|
|
const updatedAt = mainContent?.getAttribute('data-page-updated-at');
|
|
|
const deletedAt = mainContent?.getAttribute('data-page-deleted-at') || null;
|
|
|
const isUserPage = JSON.parse(mainContent?.getAttribute('data-page-user') || jsonNull);
|