diff --git a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html
index d4eded25e8..7f3bdf330c 100644
--- a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html
+++ b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html
@@ -33,27 +33,25 @@
class="adf-share-link__date-time-container">
{{ 'SHARE.EXPIRATION-PLACEHOLDER' | translate }}
-
-
-
-
+
+
+
+ [matDatepicker]="datePicker" />
{{ 'SHARE.SHARE-LINK' | translate }}
@@ -69,7 +67,10 @@
{{ 'SHARE.SHARABLE-LINK-CREATED' | translate }}
-
+
();
@@ -86,7 +86,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
}
ngOnInit() {
- this.type = this.appConfigService.get('sharedLinkDateTimePickerType', 'datetime');
+ this.type = this.appConfigService.get('sharedLinkDateTimePickerType', 'date');
if (this.data.node && this.data.node.entry) {
this.fileName = this.data.node.entry.name;
@@ -156,8 +156,8 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
}
}
- onDatetimepickerClosed() {
- this.dateTimePickerInput.nativeElement.blur();
+ onDatePickerClosed() {
+ this.datePickerInput.nativeElement.blur();
if (!this.time.value) {
this.slideToggleExpirationDate.checked = false;
}
@@ -283,7 +283,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
let expiryDate: Date | string;
if (date) {
if (this.type === 'date') {
- expiryDate = format(endOfDay(date as Date), `yyyy-MM-dd'T'HH:mm:ss.SSSxx`);
+ expiryDate = format(endOfDay(new Date(date)), `yyyy-MM-dd'T'HH:mm:ss.SSSxx`);
} else {
expiryDate = format((new Date(date)), `yyyy-MM-dd'T'HH:mm:ss.SSSxx`);
}