annotate client/src/lib/date.js @ 1522:b34caa449c01

add date,js
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 06 Dec 2018 16:50:28 +0100
parents
children 4dbed34f8738
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1522
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 const formatSurveyDate = current => {
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 return current
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 ? new Date(current).toLocaleDateString({
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 weekday: "short",
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 day: "2-digit",
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 month: "2-digit"
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 })
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 : "";
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 };
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10
b34caa449c01 add date,js
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 export { formatSurveyDate };