mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
resolved nested ternary date operation into an independent statement
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user