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 { import {
basicSlicesOfDay, basicSlicesOfDay,
DateChoice, DateChoice,
defaultTimeOfDay,
moreTimeOfDay, moreTimeOfDay,
otherDefaultDates, otherDefaultDates,
TimeSlices, TimeSlices,
@ -35,13 +36,13 @@ export class StorageService {
public dateChoices: DateChoice[] = []; public dateChoices: DateChoice[] = [];
@LocalStorage() @LocalStorage()
public timeSlices: TimeSlices[]; public timeSlices: TimeSlices[] = defaultTimeOfDay;
@LocalStorage() @LocalStorage()
public vote_stack: Stack = new Stack(); public vote_stack: Stack = new Stack();
@LocalStorage() @LocalStorage()
public choices: Choice[]; public choices: Choice[] = [];
constructor(public dateUtilities: DateUtilitiesService) { constructor(public dateUtilities: DateUtilitiesService) {
if (environment.autofill) { if (environment.autofill) {

View File

@ -24,8 +24,14 @@
</button> </button>
<br /> <br />
<br /> <br />
<div *ngFor="let choice of dateList; index as id" class="date-choice" cdkDrag> <div
<i class="fa fa-arrow-v"></i> *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 <input
[(ngModel)]="choice.date_object" [(ngModel)]="choice.date_object"
(keyup)="keyOnChoice($event, id)" (keyup)="keyOnChoice($event, id)"

View File

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

View File

@ -145,4 +145,9 @@ export class DayListComponent {
openKeyboardShortcutsModal() { openKeyboardShortcutsModal() {
this.display = true; 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 { mat-checkbox {
display: block; display: block;
} }
.cdk-drag {
cursor: pointer;
border-left: 3px white;
&:hover {
border-left: 3px #ccc;
}
}