Skip to content
Commits on Source (3)
......@@ -171,7 +171,8 @@
#thresholdInput
></m-wire-threshold-input>
<m-poster-date-selector
[date]="blog.time_created"
*ngIf="!blog.time_published"
[date]="getTimeCreated()"
(dateChange)="onTimeCreatedChange($event)"
(onError)="posterDateSelectorError($event)"
></m-poster-date-selector>
......
......@@ -344,4 +344,10 @@ export class BlogEdit {
onTimeCreatedChange(newDate) {
this.blog.time_created = newDate;
}
getTimeCreated() {
return this.blog.time_created > Math.floor(Date.now() / 1000)
? this.blog.time_created
: null;
}
}
......@@ -181,7 +181,7 @@
[(enabled)]="activity.paywall"
></m-wire-threshold-input>
<m-poster-date-selector
[date]="activity.time_created"
[date]="getTimeCreated()"
(dateChange)="onTimeCreatedChange($event)"
(onError)="posterDateSelectorError($event)"
></m-poster-date-selector>
......
......@@ -577,4 +577,10 @@ export class Activity implements OnInit {
posterDateSelectorError(msg) {
throw new Error(msg);
}
getTimeCreated() {
return this.activity.time_created > Math.floor(Date.now() / 1000)
? this.activity.time_created
: null;
}
}