mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
style calendar step
This commit is contained in:
parent
e99a86bb4b
commit
d538af4ca1
@ -48,6 +48,7 @@ export class PollService implements Resolve<Poll> {
|
||||
public allowSeveralHours = false;
|
||||
public richTextMode = false;
|
||||
public calendar: Date[] = [new Date()];
|
||||
public disabled_dates: Date[] = [];
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@ -71,6 +72,10 @@ export class PollService implements Resolve<Poll> {
|
||||
this.DateUtilitiesService.addDaysToDate(2, new Date()),
|
||||
this.DateUtilitiesService.addDaysToDate(3, new Date()),
|
||||
];
|
||||
// disable days before today
|
||||
for (let i = 1; i < 31; i++) {
|
||||
this.disabled_dates.push(this.DateUtilitiesService.addDaysToDate(-i, new Date()));
|
||||
}
|
||||
if (environment.autofill_creation) {
|
||||
this.setDemoValues();
|
||||
this.toastService.display('auto fill de création fait');
|
||||
|
@ -6,18 +6,23 @@
|
||||
{{ pollService.calendar.length }}
|
||||
</span>
|
||||
<span> - {{ 'dates.count_dates' | translate }} </span>
|
||||
<div class="calendar">
|
||||
|
||||
<div class="calendar" *ngIf="mode_calendar">
|
||||
<p-calendar
|
||||
[(ngModel)]="pollService.calendar"
|
||||
firstDayOfWeek="5"
|
||||
firstDayOfWeek="1"
|
||||
selectionMode="multiple"
|
||||
inputId="multiple"
|
||||
showButtonBar="true"
|
||||
[locale]="'calendar_widget' | translate"
|
||||
[disabledDates]="pollService.disabled_dates"
|
||||
[inline]="true"
|
||||
[showWeek]="true"
|
||||
[showWeek]="false"
|
||||
></p-calendar>
|
||||
</div>
|
||||
<button class="button" (click)="mode_calendar = !mode_calendar" [ngClass]="{ 'is-primary': !mode_calendar }">
|
||||
Saisir les dates manuellement
|
||||
</button>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
@ -32,6 +37,9 @@
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
{{ 'dates.add_time' | translate }}
|
||||
</button>
|
||||
<button class="button" (click)="pollService.allowSeveralHours = !pollService.allowSeveralHours">
|
||||
Horaires différentes pour chaque jour
|
||||
</button>
|
||||
<button
|
||||
(click)="pollService.removeAllTimes()"
|
||||
*ngIf="pollService.timeList.length && false == pollService.allowSeveralHours"
|
||||
|
@ -12,6 +12,7 @@ export class StepThreeComponent implements OnInit {
|
||||
step_max: any;
|
||||
@Input()
|
||||
form: any;
|
||||
public mode_calendar = true;
|
||||
|
||||
constructor(public pollService: PollService) {
|
||||
this.pollService.step_current = 3;
|
||||
|
@ -596,7 +596,7 @@
|
||||
"SV": "sv"
|
||||
},
|
||||
"calendar_widget": {
|
||||
"startsWith": "Starts with",
|
||||
"startsWith": "Commence par",
|
||||
"contains": "Contains",
|
||||
"notContains": "Not contains",
|
||||
"endsWith": "Ends with",
|
||||
@ -607,21 +607,21 @@
|
||||
"lte": "Less than or equal to",
|
||||
"gt": "Greater than",
|
||||
"gte": "Great then or equals",
|
||||
"is": "Is",
|
||||
"isNot": "Is not",
|
||||
"before": "Before",
|
||||
"after": "After",
|
||||
"clear": "Clear",
|
||||
"apply": "Apply",
|
||||
"is": "Est",
|
||||
"isNot": "N'est pas",
|
||||
"before": "Avant",
|
||||
"after": "Après",
|
||||
"clear": "Vider",
|
||||
"apply": "Appliquer",
|
||||
"matchAll": "Match All",
|
||||
"matchAny": "Match Any",
|
||||
"addRule": "Add Rule",
|
||||
"removeRule": "Remove Rule",
|
||||
"accept": "Yes",
|
||||
"reject": "No",
|
||||
"choose": "Choose",
|
||||
"accept": "Oui",
|
||||
"reject": "Non",
|
||||
"choose": "Choisir",
|
||||
"upload": "Upload",
|
||||
"cancel": "Cancel",
|
||||
"cancel": "Annuler",
|
||||
"dayNames": [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
@ -632,21 +632,21 @@
|
||||
"Saturday"
|
||||
],
|
||||
"dayNamesShort": [
|
||||
"Sun",
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat"
|
||||
"Dim",
|
||||
"Lun",
|
||||
"Mar",
|
||||
"Mer",
|
||||
"Jeu",
|
||||
"Ven",
|
||||
"Sam"
|
||||
],
|
||||
"dayNamesMin": [
|
||||
"Su",
|
||||
"Mo",
|
||||
"Tu",
|
||||
"We",
|
||||
"Th",
|
||||
"Fr",
|
||||
"Di",
|
||||
"Lu",
|
||||
"Ma",
|
||||
"Me",
|
||||
"Je",
|
||||
"Ve",
|
||||
"Sa"
|
||||
],
|
||||
"monthNames": [
|
||||
|
@ -266,9 +266,16 @@ mat-checkbox {
|
||||
|
||||
// calendar primeng
|
||||
.p-datepicker {
|
||||
border: solix 1px $logo_color;
|
||||
border: solid 1px $logo_color;
|
||||
padding: 0.5em;
|
||||
margin: 1em auto;
|
||||
|
||||
button {
|
||||
border: solid 1px $primary_color;
|
||||
}
|
||||
.p-datepicker-buttonbar {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
.pi-chevron-left:after {
|
||||
content: '<';
|
||||
}
|
||||
@ -307,6 +314,21 @@ mat-checkbox {
|
||||
color: $white;
|
||||
border-radius: 100%;
|
||||
}
|
||||
.p-disabled {
|
||||
background: $d-grey;
|
||||
color: $grey;
|
||||
}
|
||||
.p-datepicker-other-month {
|
||||
color: white;
|
||||
}
|
||||
// weekend days
|
||||
tr > td {
|
||||
&:nth-of-type(6),
|
||||
&:nth-of-type(7) {
|
||||
//border-left: 1px solid $border-color;
|
||||
background: $grey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.advanced-config {
|
||||
|
Loading…
Reference in New Issue
Block a user