Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/api/src/activities/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface IActivity<T extends string = string> {
/**
* Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.
*/
timestamp?: Date;
timestamp?: string;

/**
* A locale name for the contents of the text field.
Expand All @@ -50,7 +50,7 @@ export interface IActivity<T extends string = string> {
*
* For example, 2016-09-23T13:07:49.4714686-07:00.
*/
localTimestamp?: Date;
localTimestamp?: string;

/**
* Contains an ID that uniquely identifies the channel. Set by the channel.
Expand Down Expand Up @@ -138,7 +138,7 @@ export class Activity<T extends string = string> implements IActivity<T> {
/**
* Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.
*/
timestamp?: Date;
timestamp?: string;

/**
* A locale name for the contents of the text field.
Expand All @@ -154,7 +154,7 @@ export class Activity<T extends string = string> implements IActivity<T> {
*
* For example, 2016-09-23T13:07:49.4714686-07:00.
*/
localTimestamp?: Date;
localTimestamp?: string;

/**
* Contains an ID that uniquely identifies the channel. Set by the channel.
Expand Down Expand Up @@ -302,8 +302,8 @@ export class Activity<T extends string = string> implements IActivity<T> {
return this;
}

withTimestamp(value: Date) {
this.timestamp = value;
withTimestamp(value: Date | string) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should review if this method should be marked as obsolete, along with changes in #525. Timestamps set on outgoing activities are ignored

this.timestamp = value instanceof Date ? value.toISOString() : value;
return this;
Comment on lines +305 to 307
}

Expand All @@ -312,8 +312,8 @@ export class Activity<T extends string = string> implements IActivity<T> {
return this;
}

withLocalTimestamp(value: Date) {
this.localTimestamp = value;
withLocalTimestamp(value: Date | string) {
this.localTimestamp = value instanceof Date ? value.toISOString() : value;
return this;
Comment on lines +315 to 317
}

Expand Down
Loading