resolved nested ternary date operation into an independent statement

This commit is contained in:
Jatin_Chugh
2023-06-07 10:45:59 +05:30
parent c9b737287c
commit 29981c575a
@@ -281,10 +281,16 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
private updateNode(date: moment.Moment) { private updateNode(date: moment.Moment) {
const expiryDate = date let expiryDate: Date | string;
? (this.type === 'date' ? date.endOf('day').utc().format('YYYY-MM-DDTHH:mm:ss.SSSZ') if (date) {
: date.utc().format('YYYY-MM-DDTHH:mm:ss.SSSZ')) if (this.type === 'date') {
: null; expiryDate = date.endOf('day').utc().format('YYYY-MM-DDTHH:mm:ss.SSSZ');
} else {
expiryDate = date.utc().format('YYYY-MM-DDTHH:mm:ss.SSSZ');
}
} else {
expiryDate = null;
}
if (this.sharedId && expiryDate) { if (this.sharedId && expiryDate) {
this.isDisabled = true; this.isDisabled = true;