Mercurial > gemma
comparison client/src/components/identify/formatter.js @ 4691:65a67b3492fd
client: formatter: unify date formatting
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 16 Oct 2019 15:31:09 +0200 |
parents | b263d9ae0057 |
children | 391cc6291ea4 |
comparison
equal
deleted
inserted
replaced
4690:b263d9ae0057 | 4691:65a67b3492fd |
---|---|
1 import Feature from "ol/Feature"; | 1 import Feature from "ol/Feature"; |
2 import app from "@/main"; | 2 import app from "@/main"; |
3 import filters from "@/lib/filters"; | |
3 | 4 |
4 const formatter = { | 5 const formatter = { |
5 all(p) { | 6 all(p) { |
6 if (p.key === "objnam") p.key = app.$gettext("Name"); | 7 if (p.key === "objnam") p.key = app.$gettext("Name"); |
7 if (p.key === "objname") p.key = app.$gettext("Name"); | 8 if (p.key === "objname") p.key = app.$gettext("Name"); |
11 (p.key === "date_info" || | 12 (p.key === "date_info" || |
12 p.key === "fa_date_info" || | 13 p.key === "fa_date_info" || |
13 p.key === "gm_measuredate") && | 14 p.key === "gm_measuredate") && |
14 p.val !== null | 15 p.val !== null |
15 ) { | 16 ) { |
16 p.val = new Date(p.val).toLocaleString(); | 17 p.val = filters.dateTime(p.val); |
17 } | 18 } |
18 | 19 |
19 // remove certain props | 20 // remove certain props |
20 let propsToRemove = ["bbox"]; | 21 let propsToRemove = ["bbox"]; |
21 if (propsToRemove.indexOf(p.key) !== -1) return null; | 22 if (propsToRemove.indexOf(p.key) !== -1) return null; |