indiquer le jour de la semaine avec les choix de date

This commit is contained in:
Tykayn 2021-05-18 12:27:26 +02:00 committed by tykayn
parent 2aca7ab282
commit 345b90c2e1
5 changed files with 27 additions and 4 deletions

View File

@ -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) {

View File

@ -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)"

View File

@ -0,0 +1,3 @@
.day-weekend {
background: #dedede;
}

View File

@ -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;
}
}

View File

@ -143,3 +143,11 @@ textarea {
mat-checkbox {
display: block;
}
.cdk-drag {
cursor: pointer;
border-left: 3px white;
&:hover {
border-left: 3px #ccc;
}
}