github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/time/earth/dayhour.go (about) 1 /* For license and copyright information please see LEGAL file in repository */ 2 3 package earth 4 5 // A DayHours specifies a hour of a day. 6 type DayHours uint64 7 8 // Hours 9 const ( 10 DayHours_None DayHours = 0 11 DayHours_0 DayHours = (1 << iota) 12 DayHours_0_Half 13 DayHours_1 14 DayHours_1_Half 15 DayHours_2 16 DayHours_2_Half 17 DayHours_3 18 DayHours_3_Half 19 DayHours_4 20 DayHours_4_Half 21 DayHours_5 22 DayHours_5_Half 23 DayHours_6 24 DayHours_6_Half 25 DayHours_7 26 DayHours_7_Half 27 DayHours_8 28 DayHours_8_Half 29 DayHours_9 30 DayHours_9_Half 31 DayHours_10 32 DayHours_10_Half 33 DayHours_11 34 DayHours_11_Half 35 DayHours_12 36 DayHours_12_Half 37 DayHours_13 38 DayHours_13_Half 39 DayHours_14 40 DayHours_14_Half 41 DayHours_15 42 DayHours_15_Half 43 DayHours_16 44 DayHours_16_Half 45 DayHours_17 46 DayHours_17_Half 47 DayHours_18 48 DayHours_18_Half 49 DayHours_19 50 DayHours_19_Half 51 DayHours_20 52 DayHours_20_Half 53 DayHours_21 54 DayHours_21_Half 55 DayHours_22 56 DayHours_22_Half 57 DayHours_23 58 DayHours_23_Half 59 DayHours_All = ^(DayHours(0)) 60 ) 61 62 // Check given hour exist in given day hours 63 func (dh DayHours) Check(hour DayHours) (exist bool) { return hour&dh != 0 }