Mercurial > gemma
annotate client/src/lib/date.js @ 1525:4dbed34f8738
date localized according to browserlanguage
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 07 Dec 2018 11:15:40 +0100 |
parents | b34caa449c01 |
children | 0f3b0937e7c1 |
rev | line source |
---|---|
1525
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
1 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
2 * without warranty, see README.md and license for details. |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
3 * |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
4 * SPDX-License-Identifier: AGPL-3.0-or-later |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
5 * License-Filename: LICENSES/AGPL-3.0.txt |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
6 * |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
7 * Copyright (C) 2018 by via donau |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
8 * – Österreichische Wasserstraßen-Gesellschaft mbH |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
9 * Software engineering by Intevation GmbH |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
10 * |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
11 * Author(s): |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
12 * Thomas Junk <thomas.junk@intevation.de> |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
13 */ |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
14 |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
15 import locale2 from "locale2"; |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
16 |
1522 | 17 const formatSurveyDate = current => { |
18 return current | |
1525
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
19 ? new Date(current).toLocaleDateString(locale2, { |
1522 | 20 day: "2-digit", |
1525
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
21 month: "2-digit", |
4dbed34f8738
date localized according to browserlanguage
Thomas Junk <thomas.junk@intevation.de>
parents:
1522
diff
changeset
|
22 year: "numeric" |
1522 | 23 }) |
24 : ""; | |
25 }; | |
26 | |
27 export { formatSurveyDate }; |