-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: granular office hours #312
Conversation
uint256 public immutable maxLocalHour; | ||
|
||
/// @notice The offset from UTC to local time. e.g. -5 for EST, -4 for EDT | ||
int256 public immutable localHourOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont like having the offset, working in relative time zones is pretty annoying. Would rather it was all UTC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All UTC doesn't work well with time wrapping midnight unless we use a 48 hours notation or some conditional depending on if start < end.
Having the offset is also easier for most people to read imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, I guess in most cases this will be fine, the only case it wont be is when we want to cross midnight. Then the caller will need to set some random timezone
uint256 public immutable maxLocalHour; | ||
|
||
/// @notice The offset from UTC to local time. e.g. -5 for EST, -4 for EDT | ||
int256 public immutable localHourOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, I guess in most cases this will be fine, the only case it wont be is when we want to cross midnight. Then the caller will need to set some random timezone
* office hours action * ... * feat: granular office hours (#312) * feat: granular office hours * format: forge fmt * refactor: custom errors * fix: casting * test: OfficeHoursActionTest * format: forge fmt * docs: comments * docs: comment fix * fix: weekday math * doc: fix typo * docs: add utc comment * docs: wording * chore: update gas snapshot * fix: localTimestamp for week of day * test: local time edge cases * format: forge fmt * chore: update gas snapshot --------- Co-authored-by: gzeon <[email protected]> Co-authored-by: gzeon <[email protected]>
No description provided.