sf-i-events 1.0.839 → 1.0.841
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 +24 -4
- package/src/sf-i-events.ts +29 -4
package/dev/index.html
CHANGED
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
</div>
|
|
735
735
|
|
|
736
736
|
</sf-i-events> -->
|
|
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="
|
|
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> -->
|
|
@@ -759,7 +759,7 @@
|
|
|
759
759
|
</sf-i-events> -->
|
|
760
760
|
<!-- <sf-i-events id="sf-i-events-next" name="Next Compliances" apiid="dwqyez2puoxmu.cloudfront.net/event" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" mode="next" fill="solid" username="Sachin Bhat" userprofileid="347e23a2-5ff8-4d3a-b1ab-639faf342f25" projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" projectname="Signode" myroles="["reporter"]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" blocksize="10" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024"><div slot="uploader"><sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" maxsize="5242880" allowdownload="yes"></sf-i-uploader></div><div slot="reporting"><sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting></div></sf-i-events> -->
|
|
761
761
|
<!-- <sf-i-events id="sf-i-events-next" name="Next Compliances" apiid="dwqyez2puoxmu.cloudfront.net/event" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" mode="next" fill="solid" username="Local Reporter 1" userprofileid="e9684b5d-ddbc-46d3-ae07-51706bf75410" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" myroles="["reporter"]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" blocksize="10" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024"><div slot="uploader"><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></div><div slot="reporting"><sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting></div></sf-i-events> -->
|
|
762
|
-
|
|
762
|
+
<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="Ankur Singhal" userprofileid="010834e8-108e-4a87-b58d-f5b429f184be" projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" projectname="Signode" countryid="4ab8901c-4407-4c4d-a2c7-df1a690aa0a3" myrole="viewer" showregisterexport="false" features="[]" 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">
|
|
763
763
|
|
|
764
764
|
<div slot="uploader">
|
|
765
765
|
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
|
|
@@ -768,7 +768,7 @@
|
|
|
768
768
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
769
769
|
</div>
|
|
770
770
|
|
|
771
|
-
</sf-i-events>
|
|
771
|
+
</sf-i-events>
|
|
772
772
|
<!-- <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="pattern" username="Dipti" userprofileid="d888568d-0599-46f9-9d73-55ea76345db1" projectid="c7d18a84-c2df-4dc2-b75f-5820549f5e5c" projectname="Chitale" countryid="4252b692-e47c-4244-9500-0bea51150031" enabledeletelatestreport="true" features="[]" 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="["obligationtitle"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
|
|
773
773
|
|
|
774
774
|
<div slot="uploader">
|
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
|
@@ -2963,6 +2963,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2963
2963
|
if (Object.keys(this.statisticsFiltersData).length > 0) {
|
|
2964
2964
|
filtersTableHtml += this.renderStatisticsFiltersTableStart();
|
|
2965
2965
|
}
|
|
2966
|
+
console.log('statistics', firstDate, iInit, iLast);
|
|
2966
2967
|
for (var i = iInit; i <= iLast; i++) {
|
|
2967
2968
|
let mmdd = "";
|
|
2968
2969
|
if (firstDate == null) {
|
|
@@ -2973,7 +2974,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2973
2974
|
currDate.setDate(firstDate.getDate() + (i));
|
|
2974
2975
|
mmdd = ("0" + (currDate.getMonth() + 1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
2975
2976
|
}
|
|
2976
|
-
console.log('mmddevent', mmdd, this.
|
|
2977
|
+
console.log('mmddevent', mmdd, this.statistics[mmdd], firstDate);
|
|
2977
2978
|
// var hide;
|
|
2978
2979
|
// if(firstDate == null) {
|
|
2979
2980
|
// hide = this.getCalendarRowHide(this.events[mmdd], i, lastDay, month, firstDate, null);
|
|
@@ -3037,9 +3038,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3037
3038
|
}
|
|
3038
3039
|
else {
|
|
3039
3040
|
const currDate = new Date(firstDate.getTime());
|
|
3040
|
-
currDate.setDate(firstDate.getDate() + (i
|
|
3041
|
+
currDate.setDate(firstDate.getDate() + (i));
|
|
3041
3042
|
mmdd = ("0" + (currDate.getMonth() + 1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
3042
3043
|
}
|
|
3044
|
+
console.log('mmddFilters', mmdd);
|
|
3043
3045
|
if (this.statisticsFiltersData[filtercriteria][filterid] != null) {
|
|
3044
3046
|
if (this.statisticsFiltersData[filtercriteria][filterid]['lasttime'] != null) {
|
|
3045
3047
|
lastAction = (_l = this.statisticsFiltersData[filtercriteria][filterid]['lasttime']['lastaction']) !== null && _l !== void 0 ? _l : "";
|
|
@@ -5283,7 +5285,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5283
5285
|
this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
5284
5286
|
return;
|
|
5285
5287
|
}
|
|
5286
|
-
if ((
|
|
5288
|
+
if (!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
5287
5289
|
this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
5288
5290
|
return;
|
|
5289
5291
|
}
|
|
@@ -5312,6 +5314,23 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5312
5314
|
this.renderCompletenessGraph(eventContainer);
|
|
5313
5315
|
}
|
|
5314
5316
|
};
|
|
5317
|
+
this.isLessThanYearApart = (date1, date2) => {
|
|
5318
|
+
let d1 = new Date(date1);
|
|
5319
|
+
let d2 = new Date(date2);
|
|
5320
|
+
// Ensure d1 is always the earlier date
|
|
5321
|
+
if (d1 > d2) {
|
|
5322
|
+
[d1, d2] = [d2, d1];
|
|
5323
|
+
}
|
|
5324
|
+
// Check if the dates are exactly one year apart (same month & day)
|
|
5325
|
+
if (d2.getFullYear() - d1.getFullYear() === 1 && d2.getMonth() === d1.getMonth() && d2.getDate() === d1.getDate()) {
|
|
5326
|
+
return false;
|
|
5327
|
+
}
|
|
5328
|
+
// Calculate difference in milliseconds
|
|
5329
|
+
const diffInMs = d2.getTime() - d1.getTime();
|
|
5330
|
+
// One full year in milliseconds, considering leap years
|
|
5331
|
+
const oneYearInMs = 365.25 * 24 * 60 * 60 * 1000;
|
|
5332
|
+
return diffInMs < oneYearInMs;
|
|
5333
|
+
};
|
|
5315
5334
|
this.processDateSelectionViewer = async (eventContainer) => {
|
|
5316
5335
|
// var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
|
|
5317
5336
|
// var endDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + (parseInt(this.calendarStartYYYY) + 1));
|
|
@@ -5396,7 +5415,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5396
5415
|
this._SfStreamEventStatus.innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
5397
5416
|
return;
|
|
5398
5417
|
}
|
|
5399
|
-
if ((
|
|
5418
|
+
if (!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
5419
|
+
console.log('dates entered', valueEnd, valueStart);
|
|
5400
5420
|
this._SfStreamEventStatus.innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
5401
5421
|
return;
|
|
5402
5422
|
}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -5237,6 +5237,7 @@ export class SfIEvents extends LitElement {
|
|
|
5237
5237
|
if(Object.keys(this.statisticsFiltersData).length > 0){
|
|
5238
5238
|
filtersTableHtml += this.renderStatisticsFiltersTableStart()
|
|
5239
5239
|
}
|
|
5240
|
+
console.log('statistics', firstDate, iInit, iLast)
|
|
5240
5241
|
for(var i = iInit; i <= iLast; i++) {
|
|
5241
5242
|
|
|
5242
5243
|
let mmdd : string = "";
|
|
@@ -5250,7 +5251,7 @@ export class SfIEvents extends LitElement {
|
|
|
5250
5251
|
}
|
|
5251
5252
|
|
|
5252
5253
|
|
|
5253
|
-
console.log('mmddevent', mmdd,this.
|
|
5254
|
+
console.log('mmddevent', mmdd,this.statistics[mmdd], firstDate);
|
|
5254
5255
|
|
|
5255
5256
|
// var hide;
|
|
5256
5257
|
// if(firstDate == null) {
|
|
@@ -5334,9 +5335,10 @@ export class SfIEvents extends LitElement {
|
|
|
5334
5335
|
mmdd = ("0" + (month+1)).slice(-2) + "/" + ("0" + i).slice(-2);
|
|
5335
5336
|
} else {
|
|
5336
5337
|
const currDate = new Date(firstDate.getTime());
|
|
5337
|
-
currDate.setDate(firstDate.getDate() + (i
|
|
5338
|
+
currDate.setDate(firstDate.getDate() + (i));
|
|
5338
5339
|
mmdd = ("0" + (currDate.getMonth()+1)).slice(-2) + "/" + ("0" + currDate.getDate()).slice(-2);
|
|
5339
5340
|
}
|
|
5341
|
+
console.log('mmddFilters', mmdd)
|
|
5340
5342
|
if(this.statisticsFiltersData[filtercriteria][filterid] != null){
|
|
5341
5343
|
if(this.statisticsFiltersData[filtercriteria][filterid]['lasttime'] != null){
|
|
5342
5344
|
lastAction = this.statisticsFiltersData[filtercriteria][filterid]['lasttime']['lastaction'] ?? ""
|
|
@@ -7916,7 +7918,7 @@ export class SfIEvents extends LitElement {
|
|
|
7916
7918
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
7917
7919
|
return;
|
|
7918
7920
|
}
|
|
7919
|
-
if((
|
|
7921
|
+
if(!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
7920
7922
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
7921
7923
|
return;
|
|
7922
7924
|
}
|
|
@@ -7948,6 +7950,28 @@ export class SfIEvents extends LitElement {
|
|
|
7948
7950
|
|
|
7949
7951
|
}
|
|
7950
7952
|
|
|
7953
|
+
isLessThanYearApart = (date1: string | Date, date2: string | Date) => {
|
|
7954
|
+
let d1: Date = new Date(date1);
|
|
7955
|
+
let d2: Date = new Date(date2);
|
|
7956
|
+
|
|
7957
|
+
// Ensure d1 is always the earlier date
|
|
7958
|
+
if (d1 > d2) {
|
|
7959
|
+
[d1, d2] = [d2, d1];
|
|
7960
|
+
}
|
|
7961
|
+
|
|
7962
|
+
// Check if the dates are exactly one year apart (same month & day)
|
|
7963
|
+
if (d2.getFullYear() - d1.getFullYear() === 1 && d2.getMonth() === d1.getMonth() && d2.getDate() === d1.getDate()) {
|
|
7964
|
+
return false;
|
|
7965
|
+
}
|
|
7966
|
+
|
|
7967
|
+
// Calculate difference in milliseconds
|
|
7968
|
+
const diffInMs = d2.getTime() - d1.getTime();
|
|
7969
|
+
|
|
7970
|
+
// One full year in milliseconds, considering leap years
|
|
7971
|
+
const oneYearInMs = 365.25 * 24 * 60 * 60 * 1000;
|
|
7972
|
+
|
|
7973
|
+
return diffInMs < oneYearInMs;
|
|
7974
|
+
}
|
|
7951
7975
|
processDateSelectionViewer = async (eventContainer: HTMLDivElement) => {
|
|
7952
7976
|
|
|
7953
7977
|
// var startDateCalendar = new Date(this.calendarStartMM + '/' + this.calendarStartDD + '/' + this.calendarStartYYYY);
|
|
@@ -8034,7 +8058,8 @@ export class SfIEvents extends LitElement {
|
|
|
8034
8058
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen End Date cannot be earlier than chosen Start Date";
|
|
8035
8059
|
return;
|
|
8036
8060
|
}
|
|
8037
|
-
if((
|
|
8061
|
+
if(!this.isLessThanYearApart(valueEnd, valueStart)) {
|
|
8062
|
+
console.log('dates entered', valueEnd, valueStart);
|
|
8038
8063
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Chosen time window cannot be greater than 365 days";
|
|
8039
8064
|
return;
|
|
8040
8065
|
}
|