Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Timezone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
#include <avr/eeprom.h>
#endif

TimeChangeRule::TimeChangeRule(const char *a, uint8_t w, uint8_t d,
uint8_t m, uint8_t h, int o)
: week(w), dow(d), month(m), hour(h), offset(o)
{
strncpy(abbrev, a, sizeof(abbrev));
}

/*----------------------------------------------------------------------*
* Create a Timezone object from the given time change rules. *
*----------------------------------------------------------------------*/
Expand Down
4 changes: 4 additions & 0 deletions src/Timezone.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ struct TimeChangeRule
uint8_t month; // 1=Jan, 2=Feb, ... 12=Dec
uint8_t hour; // 0-23
int offset; // offset from UTC in minutes

TimeChangeRule() = default;
TimeChangeRule(const char *abbrev, uint8_t week, uint8_t dow,
uint8_t month, uint8_t hour, int offset);
};

class Timezone
Expand Down