OpenEVSE / openevse_esp32_firmware

OpenEVSE V4 WiFi gateway using ESP32
170 stars 112 forks source link

Local date format and its further processing #716

Open NJbubo opened 1 year ago

NJbubo commented 1 year ago

The date and time showing wrong. Local date format is "2023. 09. 01". I think the local date and time format and its further processing is wrong method. It doesn't include these separator characters, and not where the program expects them. The year number not the last element of the date. Screenshot_1 Screenshot_2 Screenshot_3

jeremypoulter commented 1 year ago

Screenshot_20230901-111204.png

The year and separator are down to the localisation settings of your OS/Browser I think so that is correct, but indeed there do seem to be a few rendering issues with those settings. What Timezone / language do you have your browser/OS set to and what Browser / OS are you using?

NJbubo commented 1 year ago

Hi, My language and localisation settings : Hungarian. Timezone : Europe / Budapest. The pictures were taken in the android / chrome system. Same date in Windows 10 / Edge.

The "openevse-gui-v2/src/lib/utils.js" file 82 row: const arr = d.toLocaleString(DateTime.DATETIME_SHORT).split(" ") Your result with split (" "): arr[0] = date, arr[1] = time, arr[2] = AM or PM. My result with split (" "): arr[0] = year, arr[1] = month, arr[2] = day, arr[3] = time, ...