validation of schedule send is modified
This commit is contained in:
parent
0f2a0bf4cb
commit
73d7f181ea
|
@ -22,12 +22,10 @@
|
|||
}
|
||||
|
||||
[contenteditable] {
|
||||
transition: padding 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
[contenteditable]:hover,
|
||||
[contenteditable]:focus {
|
||||
padding: 0.25em;
|
||||
}
|
||||
|
||||
[contenteditable]:hover {
|
||||
|
|
|
@ -101,14 +101,30 @@
|
|||
</div>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<div class="editor-actions-spacer"></div>
|
||||
<div class="editor-actions">
|
||||
<button mat-stroked-button (click)="onClickCancel()" class="mat-primary">
|
||||
취소
|
||||
</button>
|
||||
<button mat-stroked-button (click)="onClickSend()" class="mat-primary">
|
||||
예약 발송
|
||||
</button>
|
||||
<div class="actions-container">
|
||||
<div class="actions-message">
|
||||
<span *ngIf="dateIsToEarly">
|
||||
현재 시각으로부터 30분 이후로만 설정 가능합니다.
|
||||
</span>
|
||||
</div>
|
||||
<div class="actions-spacer"></div>
|
||||
<div class="actions">
|
||||
<button
|
||||
mat-stroked-button
|
||||
(click)="onClickCancel()"
|
||||
class="mat-primary"
|
||||
>
|
||||
취소
|
||||
</button>
|
||||
<button
|
||||
mat-stroked-button
|
||||
[disabled]="dateIsToEarly"
|
||||
(click)="onClickSend()"
|
||||
class="mat-primary"
|
||||
>
|
||||
예약 발송
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
.preset-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.actions-container {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
|
||||
.actions-message {
|
||||
}
|
||||
|
||||
.actions-spacer {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.actions {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ export class ScheduleSendDialogComponent implements OnInit {
|
|||
hourStep = 1;
|
||||
minuteStep = 10;
|
||||
|
||||
dateIsToEarly = false;
|
||||
|
||||
get selectedDate() {
|
||||
return this._selectedDate;
|
||||
}
|
||||
|
@ -31,6 +33,8 @@ export class ScheduleSendDialogComponent implements OnInit {
|
|||
this.minuteStep * Math.round(v.minute() / this.minuteStep)
|
||||
);
|
||||
this._selectedDate = v;
|
||||
const aa = moment().add(30, 'minutes');
|
||||
this.dateIsToEarly = v.isBefore(moment().add(30, 'minutes'));
|
||||
}
|
||||
// tslint:disable-next-line: variable-name
|
||||
private _selectedDate: moment.Moment;
|
||||
|
@ -59,10 +63,10 @@ export class ScheduleSendDialogComponent implements OnInit {
|
|||
}
|
||||
|
||||
onHourSelected(hour: number) {
|
||||
this.selectedDate.hour(hour);
|
||||
this.selectedDate = this.selectedDate.hour(hour);
|
||||
}
|
||||
onMinuteSelected(minute: number) {
|
||||
this.selectedDate.minute(minute);
|
||||
this.selectedDate = this.selectedDate.minute(minute);
|
||||
}
|
||||
|
||||
onClickPresetTommorowMorning() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user