@@ -89,23 +89,28 @@ class Constants:
8989
9090
9191class DatetimeDeltaConstants :
92- MIDNIGHT = Constant ('midnight' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
93- NIGHT = Constant ('night' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
94- MORNING_NIGHT = Constant ('morning night' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
92+ # time_value is a tuple containing (hours, minutes, seconds)
93+ MIDNIGHT = Constant ('midnight' , value = 0 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (0 , 0 , 0 ))
94+ NIGHT = Constant ('night' , value = 0 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (21 , 0 , 0 ))
95+ MORNING_NIGHT = Constant ('morning night' , value = 0 , options = [ConstantOption .DATE_VARIABLE ],
96+ time_value = lambda _ : (3 , 0 , 0 ))
9597 DAYLIGHT_CHANGE = Constant ('daylight change' , ['daylight saving' , 'daylight saving time' ], value = 0 ,
96- options = [ConstantOption .YEAR_VARIABLE , ConstantOption .DATE_VARIABLE ])
97- DAWN = Constant ('dawn' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
98- SUNRISE = Constant ('sunrise' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
99- MORNING = Constant ('morning' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
100- BREAKFAST = Constant ('breakfast' , value = 0 , options = [ConstantOption .DATE_VARIABLE ])
101-
102- MIDDAY = Constant ('midday' , value = 12 , options = [ConstantOption .DATE_VARIABLE ])
103- LUNCH = Constant ('lunch' , ['lunchtime' ], value = 12 , options = [ConstantOption .DATE_VARIABLE ])
104- AFTERNOON = Constant ('afternoon' , value = 12 , options = [ConstantOption .DATE_VARIABLE ])
105- EVENING = Constant ('evening' , value = 12 , options = [ConstantOption .DATE_VARIABLE ])
106- DINNER = Constant ('dinner' , ['dinnertime' ], value = 12 , options = [ConstantOption .DATE_VARIABLE ])
107- DUSK = Constant ('dusk' , value = 12 , options = [ConstantOption .DATE_VARIABLE ])
108- SUNSET = Constant ('sunset' , value = 12 , options = [ConstantOption .DATE_VARIABLE ])
98+ options = [ConstantOption .YEAR_VARIABLE , ConstantOption .DATE_VARIABLE ],
99+ time_value = lambda _ : (6 , 0 , 0 ))
100+ SUNRISE = Constant ('sunrise' , value = 0 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (7 , 0 , 0 ))
101+ MORNING = Constant ('morning' , value = 0 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (6 , 0 , 0 ))
102+ BREAKFAST = Constant ('breakfast' , value = 0 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (8 , 0 , 0 ))
103+
104+ MIDDAY = Constant ('midday' , value = 12 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (12 , 0 , 0 ))
105+ LUNCH = Constant ('lunch' , ['lunchtime' ], value = 12 , options = [ConstantOption .DATE_VARIABLE ],
106+ time_value = lambda _ : (12 , 0 , 0 ))
107+ AFTERNOON = Constant ('afternoon' , value = 12 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (15 , 0 , 0 ))
108+ EVENING = Constant ('evening' , value = 12 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (18 , 0 , 0 ))
109+ DINNER = Constant ('dinner' , ['dinnertime' ], value = 12 , options = [ConstantOption .DATE_VARIABLE ],
110+ time_value = lambda _ : (19 , 0 , 0 ))
111+ DAWN = Constant ('dawn' , value = 12 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (6 , 0 , 0 ))
112+ DUSK = Constant ('dusk' , value = 12 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (20 , 0 , 0 ))
113+ SUNSET = Constant ('sunset' , value = 12 , options = [ConstantOption .DATE_VARIABLE ], time_value = lambda _ : (18 , 30 , 0 ))
109114
110115 ALL = [
111116 MORNING , AFTERNOON , EVENING , NIGHT , MORNING_NIGHT , DAYLIGHT_CHANGE , MIDNIGHT , MIDDAY , DAWN , DUSK ,
0 commit comments