date en français dans le choix de vote

This commit is contained in:
Baptiste Lemoine 2019-10-03 11:48:13 +02:00
parent 1074d219dd
commit 2d060f9905
3 changed files with 58 additions and 53 deletions

View File

@ -1,5 +1,5 @@
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core'; import {LOCALE_ID, NgModule} from '@angular/core';
import {AppRoutingModule} from './app-routing.module'; import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
@ -10,61 +10,59 @@ import {FormsModule} from '@angular/forms';
import {NavigationComponent} from './ui/navigation/navigation.component'; import {NavigationComponent} from './ui/navigation/navigation.component';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {Routes} from './config/Routes'; import {Routes} from './config/Routes';
import {CommonModule} from '@angular/common'; import {CommonModule, registerLocaleData} from '@angular/common';
import { DatesComponent } from './pages/dates/dates.component'; import {DatesComponent} from './pages/dates/dates.component';
import { DebuggerComponent } from './debugger/debugger.component'; import {DebuggerComponent} from './debugger/debugger.component';
import { VisibilityComponent } from './pages/visibility/visibility.component'; import {VisibilityComponent} from './pages/visibility/visibility.component';
import { ResumeComponent } from './pages/resume/resume.component'; import {ResumeComponent} from './pages/resume/resume.component';
import { PicturesComponent } from './pages/pictures/pictures.component'; import {PicturesComponent} from './pages/pictures/pictures.component';
import { AnswersComponent } from './pages/answers/answers.component'; import {AnswersComponent} from './pages/answers/answers.component';
import { EndConfirmationComponent } from './pages/end-confirmation/end-confirmation.component'; import {EndConfirmationComponent} from './pages/end-confirmation/end-confirmation.component';
import { CreateOrRetrieveComponent } from './pages/create-or-retrieve/create-or-retrieve.component'; import {CreateOrRetrieveComponent} from './pages/create-or-retrieve/create-or-retrieve.component';
import { CalendarComponent } from './calendar/calendar.component'; import {CalendarComponent} from './calendar/calendar.component';
import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr'; import localeFr from '@angular/common/locales/fr';
import { VotingSummaryComponent } from './pages/voting-summary/voting-summary.component'; import {VotingSummaryComponent} from './pages/voting-summary/voting-summary.component';
import { VotingGraphComponent } from './pages/voting-graph/voting-graph.component'; import {VotingGraphComponent} from './pages/voting-graph/voting-graph.component';
import { VotingChoiceComponent } from './pages/voting-choice/voting-choice.component'; import {VotingChoiceComponent} from './pages/voting-choice/voting-choice.component';
import { PasswordComponent } from './pages/password/password.component'; import {PasswordComponent} from './pages/password/password.component';
import { HomeComponent } from './pages/home/home.component'; import {HomeComponent} from './pages/home/home.component';
import { VoteChoiceComponent } from './vote-choice/vote-choice.component'; import {VoteChoiceComponent} from './vote-choice/vote-choice.component';
registerLocaleData(localeFr, 'fr'); registerLocaleData(localeFr, 'fr');
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
BaseComponent, BaseComponent,
KindComponent, KindComponent,
HeaderComponent, HeaderComponent,
NavigationComponent, NavigationComponent,
DatesComponent, DatesComponent,
DebuggerComponent, DebuggerComponent,
VisibilityComponent, VisibilityComponent,
ResumeComponent, ResumeComponent,
PicturesComponent, PicturesComponent,
AnswersComponent, AnswersComponent,
EndConfirmationComponent, EndConfirmationComponent,
CreateOrRetrieveComponent, CreateOrRetrieveComponent,
CalendarComponent, CalendarComponent,
VotingSummaryComponent, VotingSummaryComponent,
VotingGraphComponent, VotingGraphComponent,
VotingChoiceComponent, VotingChoiceComponent,
PasswordComponent, PasswordComponent,
HomeComponent, HomeComponent,
VoteChoiceComponent, VoteChoiceComponent,
], ],
imports: [ imports: [
CommonModule, CommonModule,
BrowserModule, BrowserModule,
AppRoutingModule, AppRoutingModule,
FormsModule, FormsModule,
RouterModule.forRoot(Routes) RouterModule.forRoot(Routes)
], ],
providers: [], providers: [{provide: LOCALE_ID, useValue: "fr-FR"}],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { export class AppModule {
} }

View File

@ -8,6 +8,7 @@ import {AnswersComponent} from '../pages/answers/answers.component';
import {CreateOrRetrieveComponent} from '../pages/create-or-retrieve/create-or-retrieve.component'; import {CreateOrRetrieveComponent} from '../pages/create-or-retrieve/create-or-retrieve.component';
import {BaseComponent} from '../pages/base-page/base.component'; import {BaseComponent} from '../pages/base-page/base.component';
import {HomeComponent} from "../pages/home/home.component"; import {HomeComponent} from "../pages/home/home.component";
import {VoteChoiceComponent} from "../vote-choice/vote-choice.component";
/** /**
* each step in the form is a component * each step in the form is a component
@ -25,5 +26,6 @@ export const Routes =
{path: 'step/visibility', component: VisibilityComponent}, {path: 'step/visibility', component: VisibilityComponent},
{path: 'step/resume', component: ResumeComponent}, {path: 'step/resume', component: ResumeComponent},
{path: 'step/end', component: EndConfirmationComponent}, {path: 'step/end', component: EndConfirmationComponent},
{path: 'votechoice', component: VoteChoiceComponent},
] ]
; ;

View File

@ -2,12 +2,17 @@
<div class="info"> <div class="info">
<div class="date" *ngIf="choice.date"> <div class="date" *ngIf="choice.date">
<div class="date-day"> <div class="date-day">
{{choice.date | date:'Y-m-d'}} {{choice.date | date:'EEEE'}}
</div>
<div class="date-month-number">
{{choice.date | date:'dd'}}
</div>
<div class="date-month">
{{choice.date | date:'LLLL'}}
</div> </div>
<div class="date-hour"> <div class="date-hour">
{{choice.date | date:'H:i:s'}} {{choice.date | date:'H:m'}}
</div> </div>
<div class="description"> <div class="description">
{{choice.text}} {{choice.text}}
</div> </div>