Skip to content

Commit

Permalink
refactor: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
  • Loading branch information
iShibi and kyranet committed Dec 22, 2021
1 parent eb856ee commit b5cfe27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/structures/GuildScheduledEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ class GuildScheduledEvent extends Base {
* <info>This can be potentially `null` only when it's an {@link AuditLogEntryTarget}</info>
* @type {?number}
*/
this.scheduledStartTimestamp = data.scheduled_start_time ? new Date(data.scheduled_start_time).getTime() : null;
this.scheduledStartTimestamp = data.scheduled_start_time ? Date.parse(data.scheduled_start_time) : null;

/**
* The timestamp the guild scheduled event will end at,
* or `null` if the event does not have a scheduled time to end
* @type {?number}
*/
this.scheduledEndTimestamp = data.scheduled_end_time ? new Date(data.scheduled_end_time).getTime() : null;
this.scheduledEndTimestamp = data.scheduled_end_time ? Date.parse(data.scheduled_end_time) : null;

/**
* The privacy level of the guild scheduled event
Expand Down Expand Up @@ -192,7 +192,7 @@ class GuildScheduledEvent extends Base {
* @readonly
*/
get scheduledEndAt() {
return this.scheduledEndTimestamp ? new Date(this.scheduledEndTimestamp) : null;
return this.scheduledEndTimestamp && new Date(this.scheduledEndTimestamp);
}

/**
Expand Down

0 comments on commit b5cfe27

Please sign in to comment.