From c19f4b69dc105c2bbb1e0878e9ba82b96719c3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ch=C5=82odnicki?= Date: Sun, 11 Apr 2021 15:38:36 +0200 Subject: [PATCH] fix(WEATHER_LIST): format date column using date filter (#696) This has small potential to break user's values but only slight because if the value doesn't contain formatting patterns then it will be just left unchanged. So if users are currently formatting the date manually, they should see no change. --- README.md | 3 +++ TILE_EXAMPLES.md | 1 + scripts/directives/tile.html | 2 +- scripts/globals/constants.js | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e2c9918..1382c2ec 100644 --- a/README.md +++ b/README.md @@ -405,6 +405,9 @@ Tile Object. [Click here for some real-life examples](TILE_EXAMPLES.md) * Full documentation on fields is below */ fields: {}, + /** type: WEATHER_LIST **/ + /** defines the date format used in the date column */ + dateFormat: 'MMM d', // See https://docs.angularjs.org/api/ng/filter/date for info on formatting syntax. /** type: HISTORY **/ entity: 'sensor.temperatur_innen_gefiltert', // Entity ID (or an array of IDs) to render history for. Default: entity `id` of the tile itself offset: 24*3600*1000*5, // Start point of the history counting from now(). Default: one day diff --git a/TILE_EXAMPLES.md b/TILE_EXAMPLES.md index e92bcce5..4b2b6aef 100644 --- a/TILE_EXAMPLES.md +++ b/TILE_EXAMPLES.md @@ -718,6 +718,7 @@ The example below is for the OpenWeatherMap provider. The configuration can vary }, hideHeader: false, secondaryTitle: 'Wind', + // dateFormat: 'MMM d', // default value list: [1,2,3,4,5].map(function (id) { var ENTITY_ID = 'weather.openweathermap' return { diff --git a/scripts/directives/tile.html b/scripts/directives/tile.html index 12dbbf6b..4b4da6cc 100644 --- a/scripts/directives/tile.html +++ b/scripts/directives/tile.html @@ -452,7 +452,7 @@ -
+