diff --git a/Volna42/src/Env.cpp b/Volna42/src/Env.cpp index 68a8bd2..c9d16bd 100644 --- a/Volna42/src/Env.cpp +++ b/Volna42/src/Env.cpp @@ -242,7 +242,7 @@ void Env::initDefaultTime() { t = mktime(&tm); defaultTime = t; Serial.println(F("Default time reassigned by user config")); - Serial.println(defaultTime); + // Serial.println(defaultTime); } } else { @@ -1492,10 +1492,12 @@ void Env::updateTime(time_t dt) { String tmp = ""; int tmpN; - strftime(buffer, sizeof(buffer), "%d.%m.%y", &stnow); + tmp = FPSTR(longDateFormat); + strftime(buffer, sizeof(buffer), tmp.c_str(), &stnow); fTime.date = buffer; - strftime(buffer, sizeof(buffer), "%d.%m.%Y", &stnow); + tmp = FPSTR(shortDateFormat); + strftime(buffer, sizeof(buffer), tmp.c_str(), &stnow); fTime.dateShort = buffer; strftime(buffer, sizeof(buffer), "%H:%M:%S", &stnow); @@ -1594,7 +1596,11 @@ void Env::updateTime(time_t dt) { strftime(buffer, sizeof(buffer), "%d", &stnow); tmp = buffer; - fTime.monthText = tmp + " " + fTime.monthText; + if (pgm_read_byte(&textDateFormat) == 0) { + fTime.monthText = tmp + " " + fTime.monthText; + } else if (pgm_read_byte(&textDateFormat) == 1) { + fTime.monthText = fTime.monthText + " " + tmp; + } strftime(buffer, sizeof(buffer), "%H", &stnow); tmp = buffer; diff --git a/Volna42/src/Env.h b/Volna42/src/Env.h index 283460e..31ac77d 100644 --- a/Volna42/src/Env.h +++ b/Volna42/src/Env.h @@ -58,6 +58,10 @@ extern const size_t widgetsDefaultsSize PROGMEM; extern const uint8_t cfgCelsius PROGMEM; extern const uint8_t cfg12HourFormat PROGMEM; +extern const uint8_t textDateFormat PROGMEM; +extern const char longDateFormat[] PROGMEM; +extern const char shortDateFormat[] PROGMEM; + typedef struct { unsigned int size; diff --git a/Volna42/src/UserSettings.h b/Volna42/src/UserSettings.h index a8989f5..251fcba 100644 --- a/Volna42/src/UserSettings.h +++ b/Volna42/src/UserSettings.h @@ -31,6 +31,11 @@ const char productVersion[] PROGMEM = "0.88"; const char defaultWifiAP[] PROGMEM = "VOLNA42-EINK"; // SSIDs can reach up to 32 characters in length const char defaultWifiAPP[] PROGMEM = "volnaaccess"; // A Valid Password is 8 - 63 Characters long + +const char shortDateFormat[] PROGMEM = "%d.%m.%y"; // date & time string date part format for 1.54' +const char longDateFormat[] PROGMEM = "%d.%m.%y"; // Date string format (2-string of [Clock & Date widget] used in 4.2') + +const uint8_t textDateFormat PROGMEM = 0; // Short text date format : 0 - [15 August, Thu], 1 - [August 15, Thu] (3-string of [Clock & Date widget] used in 4.2') const uint8_t cfgCelsius PROGMEM = 1; // 0-1 | Use Celsius instead of Fahrenheit by default const uint8_t cfg12HourFormat PROGMEM = 0; // 0-1 | Use 12 hour PM / AM clock format by default