@worksafevictoria/wcl7.5 1.1.0-beta.49 → 1.1.0-beta.50

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.1.0-beta.49",
3
+ "version": "1.1.0-beta.50",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -51,11 +51,22 @@ export default {
51
51
  },
52
52
  computed: {
53
53
  filteredCarouselItems() {
54
- let filtered = this.carouselItems
55
-
56
- // To be completed with filter criteria
57
-
58
- return filtered;
54
+
55
+ var todayDate = new Date()
56
+
57
+ for (var i = 0, length = this.carouselItems.length; i < length; i++) {
58
+ if (this.carouselItems[i].favorite === 'Yes') {
59
+ this.carouselItems[i].active = 'Yes'
60
+ } else if (new Date(this.carouselItems[i].dateStart).valueOf() <= todayDate.valueOf()) {
61
+ if (new Date(this.carouselItems[i].dateEnd).valueOf() >= todayDate.valueOf()) {
62
+ this.carouselItems[i].active = 'Yes'
63
+ }
64
+ }
65
+ }
66
+
67
+ let filtered = this.carouselItems.filter(e =>
68
+ e.active === 'Yes');
69
+ return filtered
59
70
  }
60
71
  },
61
72
  methods: {
@@ -72,6 +83,14 @@ export default {
72
83
  }
73
84
  }
74
85
  }
86
+ },
87
+
88
+ formatDate(date) {
89
+ return [
90
+ date.getFullYear(),
91
+ ('0' + date.getDate()).slice(-2),
92
+ ('0' + (date.getMonth() + 1)).slice(-2)
93
+ ].join('-')
75
94
  }
76
95
  }
77
96
  }
@@ -4,8 +4,8 @@ export const mockCarouselItems = [
4
4
  image:
5
5
  'https://picsum.photos/1024/480/?image=52',
6
6
  link: 'www.google.com',
7
- dateStart: '1/12/24',
8
- dateEnd: '12/12/24',
7
+ dateStart: '2024-01-12T09:45:00+11:00',
8
+ dateEnd: '2024-02-12T09:45:00+11:00',
9
9
  favorite: 'Yes'
10
10
  },
11
11
  {
@@ -13,8 +13,8 @@ export const mockCarouselItems = [
13
13
  image:
14
14
  'https://picsum.photos/1024/480/?image=54',
15
15
  link: '/asbestos-removal-notification',
16
- dateStart: '1/11/24',
17
- dateEnd: '12/12/24',
16
+ dateStart: '2024-12-01T09:45:00+11:00',
17
+ dateEnd: '2024-12-12T09:45:00+11:00',
18
18
  favorite: ''
19
19
  },
20
20
  {
@@ -22,8 +22,8 @@ export const mockCarouselItems = [
22
22
  image:
23
23
  'https://picsum.photos/1024/480/?image=56',
24
24
  link: '/dangerous-goods-licences',
25
- dateStart: '1/12/24',
26
- dateEnd: '12/12/24',
25
+ dateStart: '2024-01-12T09:45:00+11:00',
26
+ dateEnd: '2024-12-12T09:45:00+11:00',
27
27
  favorite: ''
28
28
  },
29
29
  {
@@ -31,8 +31,8 @@ export const mockCarouselItems = [
31
31
  image:
32
32
  'https://picsum.photos/1024/480/?image=58',
33
33
  link: '/construction',
34
- dateStart: '30/10/24',
35
- dateEnd: '12/12/25',
34
+ dateStart: '2025-10-30T09:45:00+11:00',
35
+ dateEnd: '2025-12-12T09:45:00+11:00',
36
36
  favorite: ''
37
37
  },
38
38
  {
@@ -40,8 +40,8 @@ export const mockCarouselItems = [
40
40
  image:
41
41
  'https://picsum.photos/1024/480/?image=60',
42
42
  link: '/construction',
43
- dateStart: '30/10/24',
44
- dateEnd: '12/12/25',
43
+ dateStart: '2024-10-30T09:45:00+11:00',
44
+ dateEnd: '2025-12-12T09:45:00+11:00',
45
45
  favorite: ''
46
46
  },
47
47
  {
@@ -49,8 +49,8 @@ export const mockCarouselItems = [
49
49
  image:
50
50
  'https://picsum.photos/1024/480/?image=62',
51
51
  link: '/construction',
52
- dateStart: '30/10/24',
53
- dateEnd: '12/12/25',
52
+ dateStart: '2024-10-30T09:45:00+11:00',
53
+ dateEnd: '2024-11-12T09:45:00+11:00',
54
54
  favorite: ''
55
55
  },
56
56
  ]