145 |
145 |
146 number = quantities[number] or tonumber(number); |
146 number = quantities[number] or tonumber(number); |
147 |
147 |
148 time = time + seconds_in_a[unit] * number; |
148 time = time + seconds_in_a[unit] * number; |
149 end }; |
149 end }; |
150 { lpeg.one_of{"this ", "in the ", "at "} * time_of_day / |
150 { (lpeg.one_of{"this ", "in the ", "at "} + true)* time_of_day / |
151 function (time_of_day) |
151 function (time_of_day) |
152 time_of_day = time_of_day:match("%S+$"); |
152 time_of_day = time_of_day:match("%S+$"); |
153 |
153 |
154 if time_of_day == "morning" and get_time_part(time, "hour") > time_of_days.morning then |
154 if time_of_day == "morning" and get_time_part(time, "hour") > time_of_days.morning then |
155 time = time + seconds_in_a.day; -- Morning has passed, so next morning |
155 time = time + seconds_in_a.day; -- Morning has passed, so next morning |