2021-01-01 22:23:27 +00:00
|
|
|
/* DateStrings.cpp
|
|
|
|
* Definitions for date strings for use with the Time library
|
|
|
|
*
|
|
|
|
* Updated for Arduino 1.5.7 18 July 2014
|
|
|
|
*
|
|
|
|
* No memory is consumed in the sketch if your code does not call any of the string methods
|
2023-05-17 19:34:41 +00:00
|
|
|
* You can change the text of the strings, make sure the short strings are each exactly 3 characters
|
2021-01-01 22:23:27 +00:00
|
|
|
* the long strings can be any length up to the constant dt_MAX_STRING_LEN defined in TimeLib.h
|
2023-05-17 19:34:41 +00:00
|
|
|
*
|
2021-01-01 22:23:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "TimeLib.h"
|
2023-05-17 19:34:41 +00:00
|
|
|
#include <Arduino.h>
|
2021-01-01 22:23:27 +00:00
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String monthNames[] = {"Error", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
|
2021-01-01 22:23:27 +00:00
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String monthStr(uint8_t month) {
|
|
|
|
return monthNames[month];
|
2021-01-01 22:23:27 +00:00
|
|
|
}
|
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String monthShortNames[] = {"Err", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
2021-01-01 22:23:27 +00:00
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String monthShortStr(uint8_t month) {
|
|
|
|
return monthShortNames[month];
|
2021-01-01 22:23:27 +00:00
|
|
|
}
|
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String dayNames[] = {"Err", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
|
2021-01-01 22:23:27 +00:00
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String dayStr(uint8_t day) {
|
|
|
|
return dayNames[day];
|
2021-01-01 22:23:27 +00:00
|
|
|
}
|
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String dayShortNames[] = {"Err", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
|
2021-01-01 22:23:27 +00:00
|
|
|
|
2023-05-17 19:34:41 +00:00
|
|
|
const String dayShortStr(uint8_t day) {
|
|
|
|
return dayShortNames[day];
|
2021-01-01 22:23:27 +00:00
|
|
|
}
|