From f871ef84e9893965e9d8e979f0bc7458dec449ee Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Wed, 5 Apr 2023 02:02:32 +0200 Subject: [PATCH] Fix date format on home page (#602) * Fix date format on home page To use custom date format * Remove debug call --- nspanel_blueprint.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 6f9040b..678ef1b 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -128,10 +128,10 @@ The goal was to create a version that allows everyone to use the NSpanel fully l value: '%d.%m' - label: 'DD/MM (ex. 22/03)' value: '%d/%m' - - label: 'M/D (ex. 3/22)' - value: '%-m/%-d' - - label: 'D/M (ex. 22/3)' + - label: 'D/M (ex. 22/3)' value: '%-d/%-m' + - label: 'M/D (ex. 3/22)' + value: '%-m/%-d' time_format: name: Time Format @@ -3796,6 +3796,9 @@ action: entity: 'unknown' ##### NSPanel Date ##### ### DATE Font Color ### + - &variables-date_format + variables: + date_format: !input "date_format" - *delay-default - service: "{{ nextion.commands.font_color }}" data: @@ -3806,8 +3809,7 @@ action: - service: "{{ nextion.commands.text_printf }}" data: component: home.date - message: "{{ (dict.values(mui[language].weekdays) | list)[now().weekday()] ~ ', ' ~ as_timestamp(now()) | timestamp_custom('%d.%m') }}" - + message: "{{ (dict.values(mui[language].weekdays) | list)[now().weekday()] ~ ', ' ~ as_timestamp(now()) | timestamp_custom(date_format) }}" ##### NSPanel Time ##### ### TIME Font Color ### - *delay-default @@ -4825,8 +4827,7 @@ action: - *delay-default ##### Display date (long) ##### - - variables: - date_format: !input "date_format" + - *variables-date_format - service: "{{ nextion.commands.text_printf }}" data: component: "{{ page_name }}.date"