Skip to content

Commit

Permalink
fix(module:timeline): update type error
Browse files Browse the repository at this point in the history
  • Loading branch information
ng-nest-moon committed May 31, 2021
1 parent 3eb37cb commit 6b6394a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/ng-nest/ui/time-ago/time-ago.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export class XTimeAgoPipe implements PipeTransform {
locale: XI18nTimeAgo = {};
private catchContent: any;
constructor(private datePipe: DatePipe, private i18n: XI18nService) {}
transform(input: XDate): string {
transform(input?: XDate): string {
if (!input) return '';
const date = XToDate(input);
if (isNaN(date.valueOf())) {
return input as string;
Expand Down
4 changes: 2 additions & 2 deletions lib/ng-nest/ui/timeline/timeline.property.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { XType, XSize, XData, XTemplate, XProperty, XIdentityProperty, XDataConvert, XWithConfig } from '@ng-nest/ui/core';
import { XType, XSize, XData, XTemplate, XProperty, XIdentityProperty, XDataConvert, XWithConfig, XDate } from '@ng-nest/ui/core';
import { Input, Component } from '@angular/core';

/**
Expand Down Expand Up @@ -45,7 +45,7 @@ export interface XTimelineNode extends XIdentityProperty {
* @zh_CN 时间
* @en_US Time
*/
time?: string | Date;
time?: XDate;
/**
* @zh_CN 内容
* @en_US Content
Expand Down

0 comments on commit 6b6394a

Please sign in to comment.