Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: webapp billing period description #1445

Open
ubinatus opened this issue Oct 31, 2024 · 2 comments
Open

bug: webapp billing period description #1445

ubinatus opened this issue Oct 31, 2024 · 2 comments

Comments

@ubinatus
Copy link

ubinatus commented Oct 31, 2024

Describe the bug

Minor bug on the billing period message that displays an invalid period range:

image

Should be from Oct1 to Oct 31 (or Nov 1) but not Nov 30. Might be because today is the last day of the month?

Current locale: GMT-5

//periods
const periodStart = new Date();
periodStart.setUTCHours(0, 0, 0, 0);
periodStart.setUTCDate(1);
const periodEnd = new Date();
periodEnd.setUTCMonth(periodEnd.getMonth() + 1);
periodEnd.setUTCDate(0);
periodEnd.setUTCHours(0, 0, 0, 0);
const daysRemaining = Math.ceil(
(periodEnd.getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)
);

@matt-aitken
Copy link
Member

Yes I'm sure you're correct on why this is happening. The UTC dates are correct but then we display using our <DateTime> React component which renders in your local browser timezone by default…

@matt-aitken
Copy link
Member

Actually ignore my last comment. That wouldn't explain why it's coming back as November 30… 😕 This is strange because the code you've included runs on our server which is UTC.

The way to fix this is with the debugger on and setting your timezone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants