@afeefa/vue-app 0.0.276 → 0.0.277
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.277
|
package/package.json
CHANGED
package/src/utils/format-date.js
CHANGED
@@ -1,16 +1,24 @@
|
|
1
|
-
export function formatDate (date,
|
1
|
+
export function formatDate (date, options = {}) {
|
2
|
+
if (options === true) {
|
3
|
+
options = {
|
4
|
+
hours: true
|
5
|
+
}
|
6
|
+
}
|
7
|
+
|
2
8
|
if (!date) {
|
3
9
|
return ''
|
4
10
|
}
|
5
11
|
|
12
|
+
const dayName = options.day ? date.toLocaleDateString('en-US', { weekday: 'long' }) + ', ' : ''
|
13
|
+
|
6
14
|
const month = addZero(date.getMonth() + 1)
|
7
15
|
const day = addZero(date.getDate())
|
8
16
|
const year = date.getFullYear()
|
9
17
|
const hour = addZero(date.getHours())
|
10
18
|
const minutes = addZero(date.getMinutes())
|
11
19
|
|
12
|
-
let dateString = `${day}.${month}.${year}`
|
13
|
-
if (hours) {
|
20
|
+
let dateString = `${dayName}${day}.${month}.${year}`
|
21
|
+
if (options.hours) {
|
14
22
|
dateString += ` um ${hour}:${minutes} Uhr`
|
15
23
|
}
|
16
24
|
return dateString
|