Skip to content

Add IsWeekend and IsWeekday methods#84

Open
walle250ai wants to merge 1 commit into
jinzhu:masterfrom
walle250ai:master
Open

Add IsWeekend and IsWeekday methods#84
walle250ai wants to merge 1 commit into
jinzhu:masterfrom
walle250ai:master

Conversation

@walle250ai

Copy link
Copy Markdown

Summary

  • Add IsWeekend() bool method to Now struct — returns true if the time is Saturday or Sunday
  • Add IsWeekday() bool method to Now struct — returns true if the time is Monday through Friday
  • Expose both as package-level functions via main.go
  • Add unit tests covering all seven weekdays and boundary times (Friday 23:59:59, Saturday 00:00:00, Sunday 23:59:59, Monday 00:00:00)

IsWeekend returns true if the time is Saturday or Sunday.
IsWeekday returns true if the time is Monday through Friday.
Both methods are also exposed as package-level functions.
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

Successfully merging this pull request may close these issues.

1 participant