forked from tykayn/funky-framadate-front
indiquer le jour de la semaine avec les choix de date
This commit is contained in:
parent
2aca7ab282
commit
345b90c2e1
@ -10,6 +10,7 @@ import { environment } from '../../../environments/environment';
|
||||
import {
|
||||
basicSlicesOfDay,
|
||||
DateChoice,
|
||||
defaultTimeOfDay,
|
||||
moreTimeOfDay,
|
||||
otherDefaultDates,
|
||||
TimeSlices,
|
||||
@ -35,13 +36,13 @@ export class StorageService {
|
||||
public dateChoices: DateChoice[] = [];
|
||||
|
||||
@LocalStorage()
|
||||
public timeSlices: TimeSlices[];
|
||||
public timeSlices: TimeSlices[] = defaultTimeOfDay;
|
||||
|
||||
@LocalStorage()
|
||||
public vote_stack: Stack = new Stack();
|
||||
|
||||
@LocalStorage()
|
||||
public choices: Choice[];
|
||||
public choices: Choice[] = [];
|
||||
|
||||
constructor(public dateUtilities: DateUtilitiesService) {
|
||||
if (environment.autofill) {
|
||||
|
@ -24,8 +24,14 @@
|
||||
</button>
|
||||
<br />
|
||||
<br />
|
||||
<div *ngFor="let choice of dateList; index as id" class="date-choice" cdkDrag>
|
||||
<i class="fa fa-arrow-v"></i>
|
||||
<div
|
||||
*ngFor="let choice of dateList; index as id"
|
||||
class="date-choice padded"
|
||||
cdkDrag
|
||||
[ngClass]="{ 'day-weekend': isWeekendDay(choice.date_object) }"
|
||||
>
|
||||
<i class="fa fa-arrows-v"></i>
|
||||
{{ choice.date_object | date: 'E':'Europe/Paris':'fr_FR' }}
|
||||
<input
|
||||
[(ngModel)]="choice.date_object"
|
||||
(keyup)="keyOnChoice($event, id)"
|
||||
|
@ -0,0 +1,3 @@
|
||||
.day-weekend {
|
||||
background: #dedede;
|
||||
}
|
@ -145,4 +145,9 @@ export class DayListComponent {
|
||||
openKeyboardShortcutsModal() {
|
||||
this.display = true;
|
||||
}
|
||||
|
||||
isWeekendDay(date_object: Date) {
|
||||
const day = date_object.getDay();
|
||||
return day === 6 || day === 0;
|
||||
}
|
||||
}
|
||||
|
@ -143,3 +143,11 @@ textarea {
|
||||
mat-checkbox {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.cdk-drag {
|
||||
cursor: pointer;
|
||||
border-left: 3px white;
|
||||
&:hover {
|
||||
border-left: 3px #ccc;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user