diff --git a/src/Timezone.cpp b/src/Timezone.cpp index fbf4fdf..110ab72 100644 --- a/src/Timezone.cpp +++ b/src/Timezone.cpp @@ -12,6 +12,13 @@ #include #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. * *----------------------------------------------------------------------*/ diff --git a/src/Timezone.h b/src/Timezone.h index 8d353ec..9e18f8f 100644 --- a/src/Timezone.h +++ b/src/Timezone.h @@ -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