mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
set default expiration time on date input for Sends (#300)
This commit is contained in:
@@ -353,6 +353,12 @@ export class AddEditComponent implements OnInit {
|
|||||||
this.showOptions = !this.showOptions;
|
this.showOptions = !this.showOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expirationDateFallbackChanged() {
|
||||||
|
this.isSafari ?
|
||||||
|
this.safariExpirationTime = this.safariExpirationTime ?? '00:00' :
|
||||||
|
this.expirationTimeFallback = this.expirationTimeFallback ?? this.datePipe.transform(new Date(), 'HH:mm');
|
||||||
|
}
|
||||||
|
|
||||||
protected async loadSend(): Promise<Send> {
|
protected async loadSend(): Promise<Send> {
|
||||||
return this.sendService.get(this.sendId);
|
return this.sendService.get(this.sendId);
|
||||||
}
|
}
|
||||||
@@ -473,13 +479,13 @@ export class AddEditComponent implements OnInit {
|
|||||||
|
|
||||||
// determine if an unsupported value already exists on the send & add that to the top of the option list
|
// determine if an unsupported value already exists on the send & add that to the top of the option list
|
||||||
// example: if the Send was created with a different client
|
// example: if the Send was created with a different client
|
||||||
if (field === DateField.ExpriationDate && this.expirationDateTimeFallback != null) {
|
if (field === DateField.ExpriationDate && this.expirationDateTimeFallback != null && this.editMode) {
|
||||||
const previousValue: TimeOption = {
|
const previousValue: TimeOption = {
|
||||||
standard: this.datePipe.transform(this.expirationDateTimeFallback, 'hh:mm a'),
|
standard: this.datePipe.transform(this.expirationDateTimeFallback, 'hh:mm a'),
|
||||||
military: this.datePipe.transform(this.expirationDateTimeFallback, 'HH:mm'),
|
military: this.datePipe.transform(this.expirationDateTimeFallback, 'HH:mm'),
|
||||||
};
|
};
|
||||||
return [previousValue, {standard: null, military: null}, ...validTimes];
|
return [previousValue, {standard: null, military: null}, ...validTimes];
|
||||||
} else if (field === DateField.DeletionDate && this.deletionDateTimeFallback != null) {
|
} else if (field === DateField.DeletionDate && this.deletionDateTimeFallback != null && this.editMode) {
|
||||||
const previousValue: TimeOption = {
|
const previousValue: TimeOption = {
|
||||||
standard: this.datePipe.transform(this.deletionDateTimeFallback, 'hh:mm a'),
|
standard: this.datePipe.transform(this.deletionDateTimeFallback, 'hh:mm a'),
|
||||||
military: this.datePipe.transform(this.deletionDateTimeFallback, 'HH:mm'),
|
military: this.datePipe.transform(this.deletionDateTimeFallback, 'HH:mm'),
|
||||||
|
|||||||
Reference in New Issue
Block a user