mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-03-26 18:33:12 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcb3c3b2ec |
@@ -636,16 +636,16 @@ bool PriceService::timeIsInPeriod(tmElements_t tm, PriceConfig pc) {
|
|||||||
|
|
||||||
tmElements_t tms;
|
tmElements_t tms;
|
||||||
tms.Year = tm.Year;
|
tms.Year = tm.Year;
|
||||||
tms.Month = pc.start_month;
|
tms.Month = pc.start_month == 0 || pc.start_month > 12 ? 1 : pc.start_month;
|
||||||
tms.Day = pc.start_dayofmonth;
|
tms.Day = pc.start_dayofmonth == 0 || pc.start_dayofmonth > 31 ? 1 : pc.start_dayofmonth;
|
||||||
tms.Hour = 0;
|
tms.Hour = 0;
|
||||||
tms.Minute = 0;
|
tms.Minute = 0;
|
||||||
tms.Second = 0;
|
tms.Second = 0;
|
||||||
|
|
||||||
tmElements_t tme;
|
tmElements_t tme;
|
||||||
tme.Year = tm.Year;
|
tme.Year = tm.Year;
|
||||||
tme.Month = pc.end_month;
|
tme.Month = pc.end_month == 0 || pc.end_month > 12 ? 12 : pc.end_month;
|
||||||
tme.Day = pc.end_dayofmonth;
|
tme.Day = pc.end_dayofmonth == 0 || pc.end_dayofmonth > 31 ? 31 : pc.end_dayofmonth;
|
||||||
tme.Hour = 23;
|
tme.Hour = 23;
|
||||||
tme.Minute = 59;
|
tme.Minute = 59;
|
||||||
tme.Second = 59;
|
tme.Second = 59;
|
||||||
|
|||||||
Reference in New Issue
Block a user