@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
|
@@ -2299,7 +2299,16 @@
|
|
|
2299
2299
|
};
|
|
2300
2300
|
EventService.prototype.sortItemByTime = function (eventsdata) {
|
|
2301
2301
|
return eventsdata.sort((function (a, b) {
|
|
2302
|
-
|
|
2302
|
+
var firstDate = new Date(a.eventDate);
|
|
2303
|
+
var secondDate = new Date(b.eventDate);
|
|
2304
|
+
return secondDate > firstDate ? 1 : -1;
|
|
2305
|
+
}));
|
|
2306
|
+
};
|
|
2307
|
+
EventService.prototype.sortItemByTimeAsc = function (eventsdata) {
|
|
2308
|
+
return eventsdata.sort((function (a, b) {
|
|
2309
|
+
var firstDate = new Date(a.eventDate);
|
|
2310
|
+
var secondDate = new Date(b.eventDate);
|
|
2311
|
+
return secondDate < firstDate ? 1 : -1;
|
|
2303
2312
|
}));
|
|
2304
2313
|
};
|
|
2305
2314
|
EventService.prototype.setEventListData = function (eventObj) {
|
|
@@ -2400,8 +2409,8 @@
|
|
|
2400
2409
|
liveEvents = this.todaysLiveEvents;
|
|
2401
2410
|
pastEvents = eventData.filter((function (pastEvent) { return pastEvent.isEventPast; }));
|
|
2402
2411
|
futureEvents = eventData.filter((function (futureEvent) { return futureEvent.isEventFuture; }));
|
|
2403
|
-
liveEvents = this.
|
|
2404
|
-
futureEvents = this.
|
|
2412
|
+
liveEvents = this.sortItemByTimeAsc(liveEvents);
|
|
2413
|
+
futureEvents = this.sortItemByTimeAsc(futureEvents);
|
|
2405
2414
|
pastEvents = this.sortItemByTime(pastEvents);
|
|
2406
2415
|
this.todaysEvents = __spread(liveEvents, futureEvents, pastEvents);
|
|
2407
2416
|
return this.todaysEvents;
|