github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/time/utc/dayhour.go (about) 1 /* For license and copyright information please see LEGAL file in repository */ 2 3 package utc 4 5 // A DayHours specifies a hour of a day. 6 type DayHours uint32 7 8 // Hours 9 const ( 10 DayHours_None DayHours = 0 11 DayHours_0 DayHours = (1 << iota) 12 DayHours_1 13 DayHours_2 14 DayHours_3 15 DayHours_4 16 DayHours_5 17 DayHours_6 18 DayHours_7 19 DayHours_8 20 DayHours_9 21 DayHours_10 22 DayHours_11 23 DayHours_12 24 DayHours_13 25 DayHours_14 26 DayHours_15 27 DayHours_16 28 DayHours_17 29 DayHours_18 30 DayHours_19 31 DayHours_20 32 DayHours_21 33 DayHours_22 34 DayHours_23 35 DayHours_All DayHours = 0b11111111111111111111111111111111 36 ) 37 38 // Check given hour exist in given day hours 39 func (dh DayHours) Check(hour DayHours) (exist bool) { return hour&dh != 0 }