diff --git a/.env.app.example b/.env.app.example index 729dbd42c03..c9e66248335 100644 --- a/.env.app.example +++ b/.env.app.example @@ -1,17 +1,21 @@ # The host address to bind to -# HOST="::" +HOST="::" # The port to listen to for incoming requests. Default is `8091` -# PORT=8091 +PORT='' # The absolute path to the directory where all files will be stored. Default is `/store` -# STORE_DIR +STORE_DIR='' # Used as secret for session. If not provided the default one is used -# SESSION_SECRET +SESSION_SECRET="zwavejsisawesome" - -# NETWORK_KEY -# HTTPS=true +# S0 Key +NETWORK_KEY='' +HTTPS='' # Set the cookie [secure](https://github.com/expressjs/session#cookiesecure) option. -# USE_SECURE_COOKIE +USE_SECURE_COOKIE='' # Mostly needed for docker users. # https://zwave-js.github.io/node-zwave-js/#/usage/external-config?id=specifying-an-external-config-db-location -# ZWAVEJS_EXTERNAL_CONFIG +ZWAVEJS_EXTERNAL_CONFIG='' + +# Browser preferred locale/tz to use for date/time formatting +TZ='' +LOCALE='' diff --git a/api/app.ts b/api/app.ts index a491472f833..bf39b91377c 100644 --- a/api/app.ts +++ b/api/app.ts @@ -1037,6 +1037,8 @@ app.get( serial_ports: [], scales: scales, sslDisabled: sslDisabled(), + tz: process.env.TZ, + locale: process.env.LOCALE, deprecationWarning: process.env.TAG_NAME === 'zwavejs2mqtt', } diff --git a/docs/guide/env-vars.md b/docs/guide/env-vars.md index ef06a9d4ee5..af4429ebdd4 100644 --- a/docs/guide/env-vars.md +++ b/docs/guide/env-vars.md @@ -29,3 +29,5 @@ This is the list of the supported environment variables: - `FORCE_DISABLE_SSL`: Set this env var to `'true'` to disable SSL. - `BASE_PATH`: Set this env var to the base path where the application is served. Default is `/`. - `UID_DISCOVERY_PREFIX`: Sets the prefix used for MQTT Discovery `unique_id` of entities. Default is `zwavejs2mqtt_`. +- `TZ`: Set this env var to the timezone you want to use on UI. Default to browser TZ. +- `LOCALE`: Set this env var to the locale you want to use on UI. Default to browser locale. diff --git a/src/components/custom/StatisticsArrows.vue b/src/components/custom/StatisticsArrows.vue index 5ed7f8a4f8f..6f510076e93 100644 --- a/src/components/custom/StatisticsArrows.vue +++ b/src/components/custom/StatisticsArrows.vue @@ -16,7 +16,7 @@ {{ node.lastActive - ? new Date(node.lastActive).toLocaleString() + ? getDateTimeString(node.lastActive) : 'Never' }} @@ -31,6 +31,8 @@