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

Promotions should use timezone in shop settings for time calculations not server time #6603

Closed
brent-hoover opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels
Promotions Issues related to the Promotions project

Comments

@brent-hoover
Copy link
Collaborator

brent-hoover commented Oct 31, 2022

Time zone is set here in the shop settings

image

I think this probably only involves changing const now = new Date() to something like const now = new Date().toLocaleString("en-US", { timeZone: "America/Chicago" }); where "America/Chicago" would be the timezone from ShopSettings. And probably want to define that function globally and maybe cache the timezone.

@brent-hoover brent-hoover added the Promotions Issues related to the Promotions project label Oct 31, 2022
@brent-hoover brent-hoover added this to the Promotions - Milestone 1 milestone Nov 8, 2022
@brent-hoover
Copy link
Collaborator Author

This should use the getShopTimeZones util that I added for state. I was thinking that we could just use state for the query but I think the addition of #6668 means that we need to have more flexibility in how we query based on time. We should think about that as we build this.

@vanpho93
Copy link
Member

FE transformed input dates into UTC before sending to server so we don't need to convert before using.

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

No branches or pull requests

2 participants