sf-i-events 1.0.838 → 1.0.840
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/dev/index.html +4 -4
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -0
- package/sf-i-events.js +46 -23
- package/src/sf-i-events.ts +51 -24
package/dev/index.html
CHANGED
|
@@ -714,7 +714,7 @@
|
|
|
714
714
|
</div>
|
|
715
715
|
|
|
716
716
|
</sf-i-events> -->
|
|
717
|
-
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Chief Compliance Officer" userprofileid="5fe96caa-1a44-4a2d-921a-920d29433eca" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="functionhead" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
717
|
+
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Chief Compliance Officer" userprofileid="5fe96caa-1a44-4a2d-921a-920d29433eca" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="functionhead" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
718
718
|
|
|
719
719
|
<div slot="uploader">
|
|
720
720
|
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
|
|
@@ -723,7 +723,7 @@
|
|
|
723
723
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
724
724
|
</div>
|
|
725
725
|
|
|
726
|
-
</sf-i-events>
|
|
726
|
+
</sf-i-events> -->
|
|
727
727
|
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Local Reporter 1" userprofileid="e9684b5d-ddbc-46d3-ae07-51706bf75410" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="reporter" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
|
|
728
728
|
|
|
729
729
|
<div slot="uploader">
|
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
</div>
|
|
735
735
|
|
|
736
736
|
</sf-i-events> -->
|
|
737
|
-
|
|
737
|
+
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Viewer J1" userprofileid="344c84d2-5976-47ff-949b-49f6fa9627eb" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="viewer" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
738
738
|
|
|
739
739
|
<div slot="uploader">
|
|
740
740
|
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
|
|
@@ -743,7 +743,7 @@
|
|
|
743
743
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
744
744
|
</div>
|
|
745
745
|
|
|
746
|
-
</sf-i-events>
|
|
746
|
+
</sf-i-events>
|
|
747
747
|
<!-- <sf-i-events projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" projectname="Signode" mode="onboarding" locations="{"India":{"Telangana":["Corporate Office","Telangana Plant"],"Karnataka":["Prime","Stopak","Wintek","Tools","Conversion"],"Gujarat":["Dahej"],"Dadra and Nagar Haveli and Daman and Diu":["Silvassa"],"Uttarakhand":["Uttarakhand"],"Maharashtra":["Pune"],"Andhra Pradesh":["AP"],"Chhattisgarh":["Chhattisgarh"],"Goa":["Goa"],"Himachal Pradesh":["HP"],"Haryana":["Haryana"],"Jharkhand":["Jharkhand"],"Madhya Pradesh":["MP"],"Odisha":["Odisha"],"Punjab":["Punjab"],"Tamil Nadu":["TN"],"Uttar Pradesh":["UP"],"West Bengal":["WB"]}}" contractstartdate="01/04/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
|
|
748
748
|
|
|
749
749
|
</sf-i-events> -->
|
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -504,6 +504,7 @@ export declare class SfIEvents extends LitElement {
|
|
|
504
504
|
attachHandlers: (eventContainer: HTMLDivElement, valueStart: string, valueEnd: string) => void;
|
|
505
505
|
processFindSelection: (eventContainer: HTMLDivElement, searchString: string) => Promise<void>;
|
|
506
506
|
processDateSelection: (eventContainer: HTMLDivElement, fetchData?: boolean, showBackgroundButton?: boolean) => Promise<void>;
|
|
507
|
+
isLessThanYearApart: (date1: string | Date, date2: string | Date) => boolean;
|
|
507
508
|
processDateSelectionViewer: (eventContainer: HTMLDivElement) => Promise<void>;
|
|
508
509
|
initFindRightCol: () => void;
|
|
509
510
|
initCustomRightCol: () => void;
|
package/sf-i-events.js
CHANGED
|
@@ -2716,6 +2716,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2716
2716
|
// }
|
|
2717
2717
|
return html;
|
|
2718
2718
|
};
|
|
2719
|
+
//(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'), showBackgroundButton)
|
|
2719
2720
|
this.renderEvents = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null, parametersTitle, showBackgroundButton) => {
|
|
2720
2721
|
var _a, _b, _c, _f, _g, _h, _j, _k;
|
|
2721
2722
|
var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithGaps = 0, reportedNonCompliance = 0;
|
|
@@ -2746,11 +2747,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2746
2747
|
}
|
|
2747
2748
|
else {
|
|
2748
2749
|
const currDate = new Date(firstDate.getTime());
|
|
2749
|
-
currDate.setDate(firstDate.getDate() + (i
|
|
2750
|
+
currDate.setDate(firstDate.getDate() + (i));
|
|
2750
2751
|
mmdd = ("0" + (currDate.getMonth() + 1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
2751
2752
|
}
|
|
2752
2753
|
//console.log('mmdd', mmdd);
|
|
2753
|
-
|
|
2754
|
+
console.log('mmddevent', mmdd, this.events[mmdd], firstDate);
|
|
2754
2755
|
var hide;
|
|
2755
2756
|
if (firstDate == null) {
|
|
2756
2757
|
hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, null);
|
|
@@ -2969,10 +2970,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2969
2970
|
}
|
|
2970
2971
|
else {
|
|
2971
2972
|
const currDate = new Date(firstDate.getTime());
|
|
2972
|
-
currDate.setDate(firstDate.getDate() + (i
|
|
2973
|
+
currDate.setDate(firstDate.getDate() + (i));
|
|
2973
2974
|
mmdd = ("0" + (currDate.getMonth() + 1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
2974
2975
|
}
|
|
2975
|
-
|
|
2976
|
+
console.log('mmddevent', mmdd, this.events[mmdd], firstDate);
|
|
2976
2977
|
// var hide;
|
|
2977
2978
|
// if(firstDate == null) {
|
|
2978
2979
|
// hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, null);
|
|
@@ -4019,10 +4020,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4019
4020
|
const lastDay = count;
|
|
4020
4021
|
let firstDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
4021
4022
|
let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
4022
|
-
endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay
|
|
4023
|
+
endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay);
|
|
4024
|
+
console.log('firstday', firstDay, endDay);
|
|
4023
4025
|
var period = ("0" + (firstDay.getMonth() + 1)).slice(-2) + "/" + ("0" + firstDay.getDate()).slice(-2) + '/' + firstDay.getFullYear() + ' - ' + ("0" + (endDay.getMonth() + 1)).slice(-2) + "/" + ("0" + endDay.getDate()).slice(-2) + '/' + endDay.getFullYear();
|
|
4024
|
-
console.log('rangeperiod', period);
|
|
4025
|
-
var html = this.renderEvents(firstDay, endDay,
|
|
4026
|
+
console.log('rangeperiod', period, lastDay);
|
|
4027
|
+
var html = this.renderEvents(firstDay, endDay, 0, lastDay, true, 0, (firstDate.getMonth()), period, firstDate, "From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'), showBackgroundButton);
|
|
4026
4028
|
eventsContainer.querySelector('.calendar-right-data').innerHTML = html;
|
|
4027
4029
|
if (eventsContainer.innerHTML.indexOf('button-select-all') < 0) {
|
|
4028
4030
|
eventsContainer.insertAdjacentHTML('beforeend', this.renderSelectAllButtons());
|
|
@@ -4698,10 +4700,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4698
4700
|
const lastDay = count;
|
|
4699
4701
|
let firstDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
4700
4702
|
let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
4701
|
-
endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay
|
|
4702
|
-
var period = ("0" + (firstDate.getMonth() + 1)).slice(-2) + "/" + ("0" + firstDate.getDate()).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (
|
|
4703
|
-
|
|
4704
|
-
var html = this.renderStatistics(firstDay, endDay,
|
|
4703
|
+
endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay);
|
|
4704
|
+
var period = ("0" + (firstDate.getMonth() + 1)).slice(-2) + "/" + ("0" + firstDate.getDate()).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (endDay.getMonth() + 1)).slice(-2) + "/" + ("0" + endDay.getDate()).slice(-2) + '/' + endDay.getFullYear();
|
|
4705
|
+
console.log('rangeperiod', period, lastDay);
|
|
4706
|
+
var html = this.renderStatistics(firstDay, endDay, 0, lastDay, true, 0, (firstDate.getMonth()), period, firstDate, "From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
|
|
4705
4707
|
eventsContainer.querySelector('.calendar-right-data').innerHTML = html;
|
|
4706
4708
|
this.renderButtonRefresh(eventsContainer);
|
|
4707
4709
|
const filterButton = eventsContainer.querySelector('#filter-button');
|
|
@@ -5281,19 +5283,20 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5281
5283
|
this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
5282
5284
|
return;
|
|
5283
5285
|
}
|
|
5284
|
-
if ((
|
|
5285
|
-
this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than
|
|
5286
|
+
if (!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
5287
|
+
this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
5286
5288
|
return;
|
|
5287
5289
|
}
|
|
5288
5290
|
const tsStart = new Date(valueStart);
|
|
5289
5291
|
const tsEnd = new Date(valueEnd);
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
+
console.log('start date', tsStart, 'endDate', tsEnd);
|
|
5293
|
+
// tsStart.setDate(tsStart.getDate() - 2);
|
|
5294
|
+
// tsEnd.setDate(tsEnd.getDate() + 2);
|
|
5292
5295
|
if (fetchData) {
|
|
5293
5296
|
await this.renderWithFeatures((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear());
|
|
5294
5297
|
// await this.fetchAndYearlyRenderUserCalendar_2((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear());
|
|
5295
5298
|
}
|
|
5296
|
-
this.renderRangeEvents(new Date(valueStart), ((new Date(valueEnd).getTime()
|
|
5299
|
+
this.renderRangeEvents(new Date(valueStart), ((new Date(valueEnd).getTime()) - new Date(valueStart).getTime()) / (1000 * 60 * 60 * 24), this._SfCustomContainer, showBackgroundButton);
|
|
5297
5300
|
}
|
|
5298
5301
|
else if (valueStart != "" && valueEnd == "") {
|
|
5299
5302
|
this._SfStreamEventStatus.innerHTML = "Please select End Date";
|
|
@@ -5309,6 +5312,23 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5309
5312
|
this.renderCompletenessGraph(eventContainer);
|
|
5310
5313
|
}
|
|
5311
5314
|
};
|
|
5315
|
+
this.isLessThanYearApart = (date1, date2) => {
|
|
5316
|
+
let d1 = new Date(date1);
|
|
5317
|
+
let d2 = new Date(date2);
|
|
5318
|
+
// Ensure d1 is always the earlier date
|
|
5319
|
+
if (d1 > d2) {
|
|
5320
|
+
[d1, d2] = [d2, d1];
|
|
5321
|
+
}
|
|
5322
|
+
// Check if the dates are exactly one year apart (same month & day)
|
|
5323
|
+
if (d2.getFullYear() - d1.getFullYear() === 1 && d2.getMonth() === d1.getMonth() && d2.getDate() === d1.getDate()) {
|
|
5324
|
+
return false;
|
|
5325
|
+
}
|
|
5326
|
+
// Calculate difference in milliseconds
|
|
5327
|
+
const diffInMs = d2.getTime() - d1.getTime();
|
|
5328
|
+
// One full year in milliseconds, considering leap years
|
|
5329
|
+
const oneYearInMs = 365.25 * 24 * 60 * 60 * 1000;
|
|
5330
|
+
return diffInMs < oneYearInMs;
|
|
5331
|
+
};
|
|
5312
5332
|
this.processDateSelectionViewer = async (eventContainer) => {
|
|
5313
5333
|
// var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
|
|
5314
5334
|
// var endDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + (parseInt(this.calendarStartYYYY) + 1));
|
|
@@ -5393,18 +5413,19 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5393
5413
|
this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
5394
5414
|
return;
|
|
5395
5415
|
}
|
|
5396
|
-
if ((
|
|
5397
|
-
|
|
5416
|
+
if (!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
5417
|
+
console.log('dates entered', valueEnd, valueStart);
|
|
5418
|
+
this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
5398
5419
|
return;
|
|
5399
5420
|
}
|
|
5400
5421
|
const tsStart = new Date(valueStart);
|
|
5401
5422
|
const tsEnd = new Date(valueEnd);
|
|
5402
|
-
tsStart.setDate(tsStart.getDate() - 2);
|
|
5403
|
-
tsEnd.setDate(tsEnd.getDate() + 2);
|
|
5423
|
+
// tsStart.setDate(tsStart.getDate() - 2);
|
|
5424
|
+
// tsEnd.setDate(tsEnd.getDate() + 2);
|
|
5404
5425
|
//console.log('tsstart', tsStart);
|
|
5405
5426
|
//console.log('tsend', tsEnd);
|
|
5406
5427
|
let meta = await this.fetchStatistics((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear(), filtercriteria, filtervalue, subfiltercriteria, subfiltervalue);
|
|
5407
|
-
this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime()
|
|
5428
|
+
this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime()) - new Date(valueStart).getTime()) / (1000 * 60 * 60 * 24), this._SfCustomContainer);
|
|
5408
5429
|
if (meta != null)
|
|
5409
5430
|
this.renderStatisticsFilters(this._SfCustomContainer);
|
|
5410
5431
|
}
|
|
@@ -18778,7 +18799,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18778
18799
|
}
|
|
18779
18800
|
};
|
|
18780
18801
|
this.fetchAdhoc = async () => {
|
|
18781
|
-
let path = "
|
|
18802
|
+
let path = "getallmyevents1", view = "";
|
|
18782
18803
|
if (this.tagId != null && this.tagId != "") {
|
|
18783
18804
|
view = "tag";
|
|
18784
18805
|
}
|
|
@@ -18800,7 +18821,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18800
18821
|
if (xhr.status == 200) {
|
|
18801
18822
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
18802
18823
|
console.log(jsonRespose);
|
|
18803
|
-
|
|
18824
|
+
let responseData = await this.fetchPresignedUrl(jsonRespose.signedUrlGet);
|
|
18825
|
+
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
|
|
18826
|
+
return responseData;
|
|
18804
18827
|
}
|
|
18805
18828
|
else {
|
|
18806
18829
|
if (xhr.status == 401) {
|
package/src/sf-i-events.ts
CHANGED
|
@@ -4947,6 +4947,7 @@ export class SfIEvents extends LitElement {
|
|
|
4947
4947
|
|
|
4948
4948
|
}
|
|
4949
4949
|
|
|
4950
|
+
//(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'), showBackgroundButton)
|
|
4950
4951
|
renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string, showBackgroundButton: boolean) => {
|
|
4951
4952
|
var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithGaps = 0, reportedNonCompliance = 0;
|
|
4952
4953
|
var html = '';
|
|
@@ -4984,12 +4985,12 @@ export class SfIEvents extends LitElement {
|
|
|
4984
4985
|
mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + i).slice(-2);
|
|
4985
4986
|
} else {
|
|
4986
4987
|
const currDate = new Date(firstDate.getTime());
|
|
4987
|
-
currDate.setDate(firstDate.getDate() + (i
|
|
4988
|
+
currDate.setDate(firstDate.getDate() + (i));
|
|
4988
4989
|
mmdd = ("0" + (currDate.getMonth()+1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
4989
4990
|
}
|
|
4990
4991
|
|
|
4991
4992
|
//console.log('mmdd', mmdd);
|
|
4992
|
-
|
|
4993
|
+
console.log('mmddevent', mmdd,this.events[mmdd], firstDate);
|
|
4993
4994
|
|
|
4994
4995
|
var hide;
|
|
4995
4996
|
if(firstDate == null) {
|
|
@@ -5244,12 +5245,12 @@ export class SfIEvents extends LitElement {
|
|
|
5244
5245
|
mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + i).slice(-2);
|
|
5245
5246
|
} else {
|
|
5246
5247
|
const currDate = new Date(firstDate.getTime());
|
|
5247
|
-
currDate.setDate(firstDate.getDate() + (i
|
|
5248
|
+
currDate.setDate(firstDate.getDate() + (i));
|
|
5248
5249
|
mmdd = ("0" + (currDate.getMonth()+1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
5249
5250
|
}
|
|
5250
5251
|
|
|
5251
5252
|
|
|
5252
|
-
|
|
5253
|
+
console.log('mmddevent', mmdd,this.events[mmdd], firstDate);
|
|
5253
5254
|
|
|
5254
5255
|
// var hide;
|
|
5255
5256
|
// if(firstDate == null) {
|
|
@@ -6435,13 +6436,13 @@ export class SfIEvents extends LitElement {
|
|
|
6435
6436
|
const lastDay = count;
|
|
6436
6437
|
let firstDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
6437
6438
|
let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
6438
|
-
endDay?.setDate(endDay.getDate() + lastDay
|
|
6439
|
-
|
|
6439
|
+
endDay?.setDate(endDay.getDate() + lastDay);
|
|
6440
|
+
console.log('firstday', firstDay, endDay)
|
|
6440
6441
|
var period = ("0" + (firstDay.getMonth()+1)).slice(-2) + "/" + ("0" + firstDay.getDate()).slice(-2) + '/' + firstDay.getFullYear() + ' - ' + ("0" + (endDay.getMonth()+1)).slice(-2) + "/" + ("0" + endDay.getDate()).slice(-2) + '/' + endDay.getFullYear();
|
|
6441
6442
|
|
|
6442
|
-
console.log('rangeperiod', period)
|
|
6443
|
+
console.log('rangeperiod', period, lastDay);
|
|
6443
6444
|
|
|
6444
|
-
var html = this.renderEvents(firstDay, endDay,
|
|
6445
|
+
var html = this.renderEvents(firstDay, endDay, 0, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'), showBackgroundButton);
|
|
6445
6446
|
|
|
6446
6447
|
eventsContainer.querySelector('.calendar-right-data')!.innerHTML = html;
|
|
6447
6448
|
if(eventsContainer.innerHTML.indexOf('button-select-all') < 0){
|
|
@@ -7229,11 +7230,11 @@ export class SfIEvents extends LitElement {
|
|
|
7229
7230
|
const lastDay = count;
|
|
7230
7231
|
let firstDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
7231
7232
|
let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
|
|
7232
|
-
endDay?.setDate(endDay.getDate() + lastDay
|
|
7233
|
-
var period = ("0" + (firstDate.getMonth()+1)).slice(-2) + "/" + ("0" + firstDate.getDate()).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (
|
|
7234
|
-
|
|
7233
|
+
endDay?.setDate(endDay.getDate() + lastDay);
|
|
7234
|
+
var period = ("0" + (firstDate.getMonth()+1)).slice(-2) + "/" + ("0" + firstDate.getDate()).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (endDay.getMonth()+1)).slice(-2) + "/" + ("0" + endDay.getDate()).slice(-2) + '/' + endDay.getFullYear();
|
|
7235
|
+
console.log('rangeperiod', period, lastDay)
|
|
7235
7236
|
|
|
7236
|
-
var html = this.renderStatistics(firstDay, endDay,
|
|
7237
|
+
var html = this.renderStatistics(firstDay, endDay, 0, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
|
|
7237
7238
|
|
|
7238
7239
|
eventsContainer.querySelector('.calendar-right-data')!.innerHTML = html;
|
|
7239
7240
|
this.renderButtonRefresh(eventsContainer);
|
|
@@ -7915,19 +7916,20 @@ export class SfIEvents extends LitElement {
|
|
|
7915
7916
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
7916
7917
|
return;
|
|
7917
7918
|
}
|
|
7918
|
-
if((
|
|
7919
|
-
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than
|
|
7919
|
+
if(!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
7920
|
+
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
7920
7921
|
return;
|
|
7921
7922
|
}
|
|
7922
7923
|
const tsStart = new Date(valueStart);
|
|
7923
7924
|
const tsEnd = new Date(valueEnd);
|
|
7924
|
-
|
|
7925
|
-
|
|
7925
|
+
console.log('start date', tsStart, 'endDate', tsEnd)
|
|
7926
|
+
// tsStart.setDate(tsStart.getDate() - 2);
|
|
7927
|
+
// tsEnd.setDate(tsEnd.getDate() + 2);
|
|
7926
7928
|
if(fetchData){
|
|
7927
7929
|
await this.renderWithFeatures((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear())
|
|
7928
7930
|
// await this.fetchAndYearlyRenderUserCalendar_2((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear());
|
|
7929
7931
|
}
|
|
7930
|
-
this.renderRangeEvents(new Date(valueStart), ((new Date(valueEnd).getTime()
|
|
7932
|
+
this.renderRangeEvents(new Date(valueStart), ((new Date(valueEnd).getTime()) - new Date(valueStart).getTime())/(1000*60*60*24), (this._SfCustomContainer as HTMLDivElement), showBackgroundButton);
|
|
7931
7933
|
} else if(valueStart != "" && valueEnd == "") {
|
|
7932
7934
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select End Date";
|
|
7933
7935
|
} else if(valueStart == "" && valueEnd != "") {
|
|
@@ -7946,6 +7948,28 @@ export class SfIEvents extends LitElement {
|
|
|
7946
7948
|
|
|
7947
7949
|
}
|
|
7948
7950
|
|
|
7951
|
+
isLessThanYearApart = (date1: string | Date, date2: string | Date) => {
|
|
7952
|
+
let d1: Date = new Date(date1);
|
|
7953
|
+
let d2: Date = new Date(date2);
|
|
7954
|
+
|
|
7955
|
+
// Ensure d1 is always the earlier date
|
|
7956
|
+
if (d1 > d2) {
|
|
7957
|
+
[d1, d2] = [d2, d1];
|
|
7958
|
+
}
|
|
7959
|
+
|
|
7960
|
+
// Check if the dates are exactly one year apart (same month & day)
|
|
7961
|
+
if (d2.getFullYear() - d1.getFullYear() === 1 && d2.getMonth() === d1.getMonth() && d2.getDate() === d1.getDate()) {
|
|
7962
|
+
return false;
|
|
7963
|
+
}
|
|
7964
|
+
|
|
7965
|
+
// Calculate difference in milliseconds
|
|
7966
|
+
const diffInMs = d2.getTime() - d1.getTime();
|
|
7967
|
+
|
|
7968
|
+
// One full year in milliseconds, considering leap years
|
|
7969
|
+
const oneYearInMs = 365.25 * 24 * 60 * 60 * 1000;
|
|
7970
|
+
|
|
7971
|
+
return diffInMs < oneYearInMs;
|
|
7972
|
+
}
|
|
7949
7973
|
processDateSelectionViewer = async (eventContainer: HTMLDivElement) => {
|
|
7950
7974
|
|
|
7951
7975
|
// var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
|
|
@@ -8032,20 +8056,21 @@ export class SfIEvents extends LitElement {
|
|
|
8032
8056
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
8033
8057
|
return;
|
|
8034
8058
|
}
|
|
8035
|
-
if((
|
|
8036
|
-
(
|
|
8059
|
+
if(!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
8060
|
+
console.log('dates entered', valueEnd, valueStart);
|
|
8061
|
+
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
8037
8062
|
return;
|
|
8038
8063
|
}
|
|
8039
8064
|
const tsStart = new Date(valueStart);
|
|
8040
8065
|
const tsEnd = new Date(valueEnd);
|
|
8041
|
-
tsStart.setDate(tsStart.getDate() - 2);
|
|
8042
|
-
tsEnd.setDate(tsEnd.getDate() + 2);
|
|
8066
|
+
// tsStart.setDate(tsStart.getDate() - 2);
|
|
8067
|
+
// tsEnd.setDate(tsEnd.getDate() + 2);
|
|
8043
8068
|
|
|
8044
8069
|
//console.log('tsstart', tsStart);
|
|
8045
8070
|
//console.log('tsend', tsEnd);
|
|
8046
8071
|
|
|
8047
8072
|
let meta = await this.fetchStatistics((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear(), filtercriteria, filtervalue, subfiltercriteria, subfiltervalue);
|
|
8048
|
-
this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime()
|
|
8073
|
+
this.renderRangeStatistics(new Date(valueStart), ((new Date(valueEnd).getTime()) - new Date(valueStart).getTime())/(1000*60*60*24), (this._SfCustomContainer as HTMLDivElement));
|
|
8049
8074
|
|
|
8050
8075
|
if(meta != null) this.renderStatisticsFilters((this._SfCustomContainer as HTMLDivElement))
|
|
8051
8076
|
} else if(valueStart != "" && valueEnd == "") {
|
|
@@ -24739,7 +24764,7 @@ export class SfIEvents extends LitElement {
|
|
|
24739
24764
|
|
|
24740
24765
|
fetchAdhoc = async () => {
|
|
24741
24766
|
|
|
24742
|
-
let path = "
|
|
24767
|
+
let path = "getallmyevents1", view = "";
|
|
24743
24768
|
|
|
24744
24769
|
if(this.tagId != null && this.tagId != "") {
|
|
24745
24770
|
view = "tag";
|
|
@@ -24763,7 +24788,9 @@ export class SfIEvents extends LitElement {
|
|
|
24763
24788
|
|
|
24764
24789
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
24765
24790
|
console.log(jsonRespose);
|
|
24766
|
-
|
|
24791
|
+
let responseData = await this.fetchPresignedUrl(jsonRespose.signedUrlGet);
|
|
24792
|
+
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
|
|
24793
|
+
return responseData;
|
|
24767
24794
|
|
|
24768
24795
|
} else {
|
|
24769
24796
|
if(xhr.status == 401){
|