Mercurial > gemma
changeset 1525:4dbed34f8738
date localized according to browserlanguage
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 07 Dec 2018 11:15:40 +0100 |
parents | a0a16577261a |
children | 3cc3b7390805 |
files | client/src/lib/date.js |
diffstat | 1 files changed, 19 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/lib/date.js Fri Dec 07 10:08:31 2018 +0100 +++ b/client/src/lib/date.js Fri Dec 07 11:15:40 2018 +0100 @@ -1,9 +1,25 @@ +/* This is Free Software under GNU Affero General Public License v >= 3.0 + * without warranty, see README.md and license for details. + * + * SPDX-License-Identifier: AGPL-3.0-or-later + * License-Filename: LICENSES/AGPL-3.0.txt + * + * Copyright (C) 2018 by via donau + * – Österreichische Wasserstraßen-Gesellschaft mbH + * Software engineering by Intevation GmbH + * + * Author(s): + * Thomas Junk <thomas.junk@intevation.de> + */ + +import locale2 from "locale2"; + const formatSurveyDate = current => { return current - ? new Date(current).toLocaleDateString({ - weekday: "short", + ? new Date(current).toLocaleDateString(locale2, { day: "2-digit", - month: "2-digit" + month: "2-digit", + year: "numeric" }) : ""; };