A couple small fixes, plus a merge from master #1

Merged
jsnbuchanan merged 45 commits from trentlarson/crowd-funder-from-jason:feat/vitejs-trent into feat/vitejs 2024-04-07 17:52:43 +00:00
Showing only changes of commit 121181c6a1 - Show all commits
+10 -4
View File
@@ -513,7 +513,7 @@ export default class App extends Vue {
); );
return false; return false;
} }
if (hourNum < 1 || hourNum > 12) { if (hourNum < 1 || 12 < hourNum) {
this.$notify( this.$notify(
{ {
group: "alert", group: "alert",
@@ -554,15 +554,21 @@ export default class App extends Vue {
-1, -1,
); );
// we already checked that this is a valid hour number // we already checked that this is a valid hour number
const hourNum = libsUtil.numberOrZero(this.hourInput); const rawHourNum = libsUtil.numberOrZero(this.hourInput);
const adjHourNum = rawHourNum + (this.hourAm ? 0 : 12);
const hourNum = adjHourNum % 24;
const utcHour = const utcHour =
hourNum + Math.round(new Date().getTimezoneOffset() / 60); hourNum + Math.round(new Date().getTimezoneOffset() / 60);
const finalUtcHour = (utcHour + (utcHour < 0 ? 24 : 0)) % 24;
// This ignore commentary is because I'm adding non-standard stuff to the subscription object. // This ignore commentary is because I'm adding non-standard stuff to the subscription object.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
subscription.notifyTime = { utcHour: utcHour }; const subscriptionWithTime = {
this.sendSubscriptionToServer(subscription); notifyTime: { utcHour: finalUtcHour },
...subscription,
};
this.sendSubscriptionToServer(subscriptionWithTime);
return subscription; return subscription;
} else { } else {
throw new Error("Subscription object is not available."); throw new Error("Subscription object is not available.");