Skip to content

Commit be8810a

Browse files
committed
2 parents 5acc658 + d1ec22c commit be8810a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
- add syndication and owner information
88

9+
## 4.43.2
10+
11+
### Patch Changes
12+
13+
- MaybePromise for getPublicationDate and getDisplayDate
14+
915
## 4.43.1
1016

1117
### Patch Changes

src/mapper/doc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ export abstract class Document<ANS extends ANSContent> {
115115
return date.toISOString();
116116
}
117117

118-
protected getDisplayDate(): Optional<Date> {
118+
protected getDisplayDate(): MaybePromise<Optional<Date>> {
119119
return new Date();
120120
}
121121

122122
protected async getContentElements(): Promise<ArcTypes.ContentElements.ContentElementType<any>[]> {
123123
return [];
124124
}
125125

126-
protected getPublicationDate(): Optional<Date> {
126+
protected getPublicationDate(): MaybePromise<Optional<Date>> {
127127
return new Date();
128128
}
129129

src/mapper/story.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends
2828
const id = await this.arcId();
2929
const version = this.version();
3030
const type = this.type();
31-
const publicationDate = this.getPublicationDate();
31+
const publicationDate = await this.getPublicationDate();
32+
const displayDate = await this.getDisplayDate();
3233
const headlines = this.getHeadlines();
3334
const subheadlines = this.getSubheadlines();
3435
const description = this.getDescription();
@@ -78,7 +79,7 @@ export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends
7879
created_date: this.formatDate(new Date()),
7980
first_publish_date: this.formatDate(publicationDate),
8081
publish_date: this.formatDate(publicationDate),
81-
display_date: this.formatDate(this.getDisplayDate()),
82+
display_date: this.formatDate(displayDate),
8283
source,
8384
comments,
8485
owner,

0 commit comments

Comments
 (0)