Skip to content

Commit

Permalink
new date tag incorrect date
Browse files Browse the repository at this point in the history
convert string timestamp to number
  • Loading branch information
Jeted committed Jan 28, 2022
1 parent b644961 commit 4da9018
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ClearChat extends Message<ClearChat> {
user!: MessageParam;

get date(): Date {
return new Date(this._tags.get('tmi-sent-ts')!);
return new Date(Number(this._tags.get('tmi-sent-ts'))!);
}

get channelId(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class UserNotice extends Message<UserNotice> {
}

get date(): Date {
return new Date(this._tags.get('tmi-sent-ts')!);
return new Date(Number(this._tags.get('tmi-sent-ts'))!);
}

get userInfo(): ChatUser {
Expand Down
2 changes: 1 addition & 1 deletion packages/chat/src/caps/twitchTags/messageTypes/ClearMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ClearMsg extends Message<ClearMsg> {
message!: MessageParam;

get date(): Date {
return new Date(this._tags.get('tmi-sent-ts')!);
return new Date(Number(this._tags.get('tmi-sent-ts'))!);
}

get userName(): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/chat/src/commands/TwitchPrivateMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class TwitchPrivateMessage extends MessageTypes.Commands.PrivateMessage {
* The date the message was sent at.
*/
get date(): Date {
return new Date(this._tags.get('tmi-sent-ts')!);
return new Date(Number(this._tags.get('tmi-sent-ts'))!);
}

/**
Expand Down

0 comments on commit 4da9018

Please sign in to comment.