AceTime 2.4.0 Date and time classes for Arduino that support timezones from the TZ Database.

DateStrings.cpp
1 /*
2 * MIT License
3 * Copyright (c) 2018 Brian T. Park
4 */
5
6 #include "DateStrings.h"
7
8 namespace ace_time {
9
10 static const char kError[] PROGMEM = "Error";
11 static const char kJanuary[] PROGMEM = "January";
12 static const char kFebruary[] PROGMEM = "February";
13 static const char kMarch[] PROGMEM = "March";
14 static const char kApril[] PROGMEM = "April";
15 static const char kMay[] PROGMEM = "May";
16 static const char kJune[] PROGMEM = "June";
17 static const char kJuly[] PROGMEM = "July";
18 static const char kAugust[] PROGMEM = "August";
19 static const char kSeptember[] PROGMEM = "September";
20 static const char kOctober[] PROGMEM = "October";
21 static const char kNovember[] PROGMEM = "November";
22 static const char kDecember[] PROGMEM = "December";
23
24 // Place pointers into PROGMEM as well, saving 26 bytes of RAM.
25 // Use getStringAt() to access.
26 const char* const DateStrings::kMonthNames[] PROGMEM = {
27 kError, kJanuary, kFebruary, kMarch, kApril, kMay, kJune,
28 kJuly, kAugust, kSeptember, kOctober, kNovember, kDecember
29 };
30
31 const uint8_t DateStrings::kNumMonthNames =
32 sizeof(kMonthNames) / sizeof(const char *);
33
34 static const char kMonday[] PROGMEM = "Monday";
35 static const char kTuesday[] PROGMEM = "Tuesday";
36 static const char kWednesday[] PROGMEM = "Wednesday";
37 static const char kThursday[] PROGMEM = "Thursday";
38 static const char kFriday[] PROGMEM = "Friday";
39 static const char kSaturday[] PROGMEM = "Saturday";
40 static const char kSunday[] PROGMEM = "Sunday";
41
42 // Place pointers into PROGMEM as well, saving 16 bytes of RAM.
43 // Use getStringAt() to access.
44 // ISO8601 says Monday=1, Sunday=7.
45 const char* const DateStrings::kDayOfWeekNames[] PROGMEM = {
46 kError, kMonday, kTuesday, kWednesday, kThursday, kFriday, kSaturday, kSunday
47 };
48
49 const uint8_t DateStrings::kNumDayOfWeekNames =
50 sizeof(kDayOfWeekNames) / sizeof(const char *);
51
52 }