Skip to content

Commit

Permalink
fix(datetime-helper): consider seconds in set_time helper (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantwrp committed Sep 15, 2024
1 parent d4b319f commit 21d16a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const datetimeHelper: HelperConstructorBlock = (ctx) => {
const parsedTime = ctx.dateAndTimeUtils.parseTime(attrs[SET_TIME] as string, ctx.dateAndTimeUtils.getTimeFormat());
now.set("hours", parsedTime.hours);
now.set("minutes", parsedTime.minutes);
now.set("seconds", 0);
now.set("seconds", parsedTime.seconds);
now.set("milliseconds", 0);
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils/dateAndTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface ParsedDate {
interface ParsedTime {
hours: number;
minutes: number;
seconds: number;
}

export class DateAndTimeUtils {
Expand Down Expand Up @@ -82,6 +83,7 @@ export class DateAndTimeUtils {
return {
hours: time.hours(),
minutes: time.minutes(),
seconds: time.seconds(),
};
}
}

0 comments on commit 21d16a9

Please sign in to comment.