@sunbird-cb/utils-v2 0.0.20 → 0.0.21
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/bundles/sunbird-cb-utils-v2.umd.js +12 -3
- package/bundles/sunbird-cb-utils-v2.umd.js.map +1 -1
- package/bundles/sunbird-cb-utils-v2.umd.min.js +1 -1
- package/bundles/sunbird-cb-utils-v2.umd.min.js.map +1 -1
- package/esm2015/lib/services/event.service.js +13 -4
- package/esm5/lib/services/event.service.js +13 -4
- package/fesm2015/sunbird-cb-utils-v2.js +12 -3
- package/fesm2015/sunbird-cb-utils-v2.js.map +1 -1
- package/fesm5/sunbird-cb-utils-v2.js +12 -3
- package/fesm5/sunbird-cb-utils-v2.js.map +1 -1
- package/lib/services/event.service.d.ts +1 -0
- package/package.json +1 -1
- package/sunbird-cb-utils-v2.metadata.json +1 -1
|
@@ -2090,7 +2090,16 @@ var EventService = (function () {
|
|
|
2090
2090
|
};
|
|
2091
2091
|
EventService.prototype.sortItemByTime = function (eventsdata) {
|
|
2092
2092
|
return eventsdata.sort((function (a, b) {
|
|
2093
|
-
|
|
2093
|
+
var firstDate = new Date(a.eventDate);
|
|
2094
|
+
var secondDate = new Date(b.eventDate);
|
|
2095
|
+
return secondDate > firstDate ? 1 : -1;
|
|
2096
|
+
}));
|
|
2097
|
+
};
|
|
2098
|
+
EventService.prototype.sortItemByTimeAsc = function (eventsdata) {
|
|
2099
|
+
return eventsdata.sort((function (a, b) {
|
|
2100
|
+
var firstDate = new Date(a.eventDate);
|
|
2101
|
+
var secondDate = new Date(b.eventDate);
|
|
2102
|
+
return secondDate < firstDate ? 1 : -1;
|
|
2094
2103
|
}));
|
|
2095
2104
|
};
|
|
2096
2105
|
EventService.prototype.setEventListData = function (eventObj) {
|
|
@@ -2191,8 +2200,8 @@ var EventService = (function () {
|
|
|
2191
2200
|
liveEvents = this.todaysLiveEvents;
|
|
2192
2201
|
pastEvents = eventData.filter((function (pastEvent) { return pastEvent.isEventPast; }));
|
|
2193
2202
|
futureEvents = eventData.filter((function (futureEvent) { return futureEvent.isEventFuture; }));
|
|
2194
|
-
liveEvents = this.
|
|
2195
|
-
futureEvents = this.
|
|
2203
|
+
liveEvents = this.sortItemByTimeAsc(liveEvents);
|
|
2204
|
+
futureEvents = this.sortItemByTimeAsc(futureEvents);
|
|
2196
2205
|
pastEvents = this.sortItemByTime(pastEvents);
|
|
2197
2206
|
this.todaysEvents = __spread(liveEvents, futureEvents, pastEvents);
|
|
2198
2207
|
return this.todaysEvents;
|