@eturnity/eturnity_reusable_components 8.7.5-EPDM-13082.0 → 8.7.5-EPDM-9631.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "8.7.5-EPDM-13082.0",
3
+ "version": "8.7.5-EPDM-9631.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -0,0 +1,51 @@
1
+ // functions for standard date and time formatting
2
+
3
+ // e.g. 13.12.2024
4
+ export const toLocaleDate = ({
5
+ locale = localStorage.getItem('lang'),
6
+ value,
7
+ }) => {
8
+ const localeLC = locale.toLowerCase()
9
+ const options = {
10
+ year: 'numeric',
11
+ month: '2-digit',
12
+ day: '2-digit',
13
+ }
14
+
15
+ return new Intl.DateTimeFormat(localeLC, options).format(Date.parse(value))
16
+ }
17
+
18
+ // e.g. 31 December 2024
19
+ export const toLocaleDateLong = ({
20
+ locale = localStorage.getItem('lang'),
21
+ value,
22
+ }) => {
23
+ const localeLC = locale.toLowerCase()
24
+ const options = {
25
+ year: 'numeric',
26
+ month: 'long',
27
+ day: '2-digit',
28
+ }
29
+
30
+ return new Intl.DateTimeFormat(localeLC, options).format(Date.parse(value))
31
+ }
32
+
33
+ // e.g. 08:45
34
+ export const toLocaleTime = ({
35
+ locale = localStorage.getItem('lang'),
36
+ value,
37
+ }) => {
38
+ const nonDefaultFormatting = {
39
+ 'es-es': { hour: '2-digit' },
40
+ 'cs-es': { hour: '2-digit' },
41
+ }
42
+
43
+ const localeLC = locale.toLowerCase()
44
+ const options = {
45
+ hour: 'numeric',
46
+ minute: 'numeric',
47
+ ...nonDefaultFormatting[localeLC],
48
+ }
49
+
50
+ return new Intl.DateTimeFormat(localeLC, options).format(Date.parse(value))
51
+ }
@@ -1,4 +0,0 @@
1
- <svg width="154" height="91" viewBox="0 0 154 91" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" fill="white" d="m113.9 6.4q-1.3-0.5-2.7-1-3.1-1.1-6.3-1.9-3.1-0.9-6.4-1.5-3.2-0.6-6.4-1-3.3-0.3-6.6-0.5-2.5-0.1-5-0.1c-34.8 0-65.5 16.7-65.6 16.8 0.1 0 10.5-1.8 24.3-3.1-21 8-34.1 17.9-34.1 17.9q2.8-0.8 5.5-1.5 6.3-1.7 12.1-3.1-3.1 1.5-6 3.2-2.9 1.7-5.8 3.6-2.9 1.9-5.6 3.9-2.8 2-5.4 4.1c0.1 0 54-20.8 81.5-16.6q0.5 0.1 1.1 0.2 0.5 0.1 1.1 0.2 0.5 0.1 1.1 0.3 0.5 0.1 1.1 0.3c17.9 5.4 14.6 16.9 11.4 22.9q-0.3 0.4-0.5 0.9-0.3 0.5-0.6 1-0.3 0.4-0.6 0.9-0.3 0.4-0.7 0.8 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0c1-0.4 16.5-6.1 23.7-13.3 10.3-9.4 14.6-24.9-4.6-33.5z"/>
3
- <path fill-rule="evenodd" fill="white" d="m131.5 63.3q0 0 0 0-0.1 0-0.1 0 0 0 0 0 0 0 0 0 3-1.6 6-3.3 2.9-1.7 5.8-3.6 2.8-1.8 5.6-3.8 2.7-2 5.4-4.2c-0.1 0.1-38.3 14.8-66.8 16.9-7.3 0.6-13.9 0.3-19.1-1.2-17.9-5.4-14.6-16.9-11.4-22.9q0 0 0 0 0.2-0.5 0.5-1 0.3-0.5 0.6-0.9 0.3-0.5 0.6-0.9 0.3-0.5 0.7-0.9h-0.1c-0.9 0.4-16.4 6.1-23.6 13.3-10.3 9.4-14.6 24.9 4.5 33.4q1.4 0.5 2.8 1c45.1 16.1 96.1-11.6 96.3-11.7-0.2 0-10.6 1.8-24.4 3.1 21-8.1 34.1-17.9 34.2-18q-9.3 2.7-17.5 4.7z"/>
4
- </svg>