Mercurial > gemma
view client/src/lib/datelocalization.js @ 5586:215e6ba9651b surveysperbottleneckid
Added property "displayName" to bottlenecks.
Before displayed, bottlenecks ordered by country
are now checked for doubles per country.
In case a double is found the displayName is enriched with the
bottleneck_id. Otherwise the displayName is equal to "name" or "objnam".
Example:
const testList = [
{
properties: {
responsible_country: "AT",
name: "Bananas",
bottleneck_id: "BN1"
}
},
{
properties: {
responsible_country: "DE",
name: "Bananas",
bottleneck_id: "BN2"
}
},
{
properties: {
responsible_country: "DE",
name: "Bananas",
bottleneck_id: "BN3"
}
}
];
is rendered to:
AT
Bananas
DE
Bananas / BN2
Bananas / BN3
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 04 Apr 2022 15:12:43 +0200 |
parents | 13575ffb8c1f |
children |
line wrap: on
line source
import app from "@/main"; const localeDateString = { dateTime: "%a %e %b %X %Y", date: "%d/%m/%Y", time: "%H:%M:%S", periods: [app.$gettext("AM"), app.$gettext("PM")], days: [ app.$gettext("Sunday"), app.$gettext("Monday"), app.$gettext("Tuesday"), app.$gettext("Wednesday"), app.$gettext("Thursday"), app.$gettext("Friday"), app.$gettext("Saturday") ], shortDays: [ app.$gettext("Sun"), app.$gettext("Mon"), app.$gettext("Tue"), app.$gettext("Wed"), app.$gettext("Thu"), app.$gettext("Fri"), app.$gettext("Sat") ], months: [ app.$gettext("January"), app.$gettext("February"), app.$gettext("March"), app.$gettext("April"), app.$gettext("May"), app.$gettext("June"), app.$gettext("July"), app.$gettext("August"), app.$gettext("September"), app.$gettext("October"), app.$gettext("November"), app.$gettext("December") ], shortMonths: [ app.$gettext("Jan"), app.$gettext("Feb"), app.$gettext("Mar"), app.$gettext("Apr"), app.$gettext("May"), app.$gettext("Jun"), app.$gettext("Jul"), app.$gettext("Aug"), app.$gettext("Sep"), app.$gettext("Oct"), app.$gettext("Nov"), app.$gettext("Dec") ] }; export { localeDateString };