diff Discovery/Src/data_central.c @ 944:44599695df41 Evo_2_23

Restructure Date/Time menu: To have more space for upcoming optins the selection of the date format (DDMMYY) has been moved into a submenu. In addition the function was upgraded to support multi language handling.
author Ideenmodellierer
date Thu, 19 Dec 2024 18:58:18 +0100
parents 63c340abd70e
children aad1a6b9aaec
line wrap: on
line diff
--- a/Discovery/Src/data_central.c	Mon Dec 16 19:33:20 2024 +0100
+++ b/Discovery/Src/data_central.c	Thu Dec 19 18:58:18 2024 +0100
@@ -972,4 +972,39 @@
     return color;
 }
 
+/* returns the date in the order defined by the settings DDMMYY => X */
+void convertStringOfDate_DDMMYY(char* pString, uint8_t strLen, uint8_t day, uint8_t month, uint8_t year)
+{
+	if(strLen > 10)
+	{
+		switch(settingsGetPointer()->date_format)
+		{
+			default:
+			case DDMMYY: snprintf(pString,strLen,"%02d.%02d.%02d",day,month,year);
+				break;
+			case MMDDYY: snprintf(pString,strLen,"%02d.%02d.%02d",month,day,year);
+				break;
+			case YYMMDD: snprintf(pString,strLen,"%02d.%02d.%02d",year,month,day);
+				break;
+		}
+	}
+}
+/* returns the format in the order defined by the settings DDMMYY => X */
+void getStringOfFormat_DDMMYY(char* pString, uint8_t strLen)
+{
+	if(strLen > 10)
+	{
+		switch(settingsGetPointer()->date_format)
+		{
+			default:
+			case DDMMYY: snprintf(pString,strLen,"%c%c",TXT_2BYTE,TXT2BYTE_DDMMYY);
+				break;
+			case MMDDYY:  snprintf(pString,strLen,"%c%c",TXT_2BYTE,TXT2BYTE_MMDDYY);
+				break;
+			case YYMMDD:  snprintf(pString,strLen,"%c%c",TXT_2BYTE,TXT2BYTE_YYMMDD);
+				break;
+		}
+	}
+}
 
+