Commit 3fa631c7 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(fix) minor view fixes

1 merge request!494WIP: epic/post-scheduler
Pipeline #77550707 passed with stages
in 45 minutes and 27 seconds
......@@ -7,7 +7,7 @@ import { DatePipe } from '@angular/common';
template: `
<div class="m-poster-date-selector--input" [class.selected]="hasDateSelected()" mdl-datetime-picker [date]="date" (dateChange)="onDateChange($event)">
<input type="text" [ngModel]="date | date:dateFormat" (ngModelChange)="onDateChange($event)" [hidden]="true">
<m-tooltip icon="date_range"> {{date || 'now'}} </m-tooltip>
<m-tooltip icon="date_range"> {{tooltipDate || 'now'}} </m-tooltip>
<span></span>
</div>
......@@ -21,14 +21,16 @@ export class PosterDateSelectorComponent {
@Input() dateFormat: string = 'short';
tooltipDate: string;
onDateChange(newDate) {
this.date = newDate;
this.date = this.tooltipDate = newDate;
newDate = new Date(newDate).getTime();
newDate = Math.floor(+newDate / 1000);
this.dateChange.emit(newDate);
}
hasDateSelected() {
return this.date && this.date !== '';
return this.tooltipDate && this.tooltipDate !== '';
}
}
m-sort-selector {
display: flex;
flex-direction: row;
align-items: center;
max-width: 100%;
> :last-child {
margin-left: auto;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment