Skip to content

Commit

Permalink
docs: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Aug 29, 2024
1 parent f82bc0c commit 59347b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gov-action-contracts/util/OfficeHoursAction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ contract OfficeHoursAction {
if (block.timestamp < minimumTimestamp) revert MinimumTimestampNotMet();

// Convert timestamp to weekday (1 = Monday, 7 = Sunday)
uint256 weekday = ((block.timestamp / 86_400 + 3) % 7) + 1;
// Addiding 3 because Unix epoch (January 1, 1970) was a Thursday
uint256 weekday = ((block.timestamp / 86_400 + 4) % 7);
if (weekday < minDayOfWeek || weekday > maxDayOfWeek) revert OutsideOfficeDays();

// This is UTC time, leap seconds are not accounted for
Expand Down

0 comments on commit 59347b3

Please sign in to comment.