Skip to content

Instantly share code, notes, and snippets.

@sekky0905
Last active December 9, 2018 08:10
Show Gist options
  • Save sekky0905/abbfbdc8dd7d2cac810d229205b03ac3 to your computer and use it in GitHub Desktop.
Save sekky0905/abbfbdc8dd7d2cac810d229205b03ac3 to your computer and use it in GitHub Desktop.
Angular4(over2~)のロケールとPipe ref: https://qiita.com/Sekky0905/items/565060b4764eb4c68bec
import {Component} from '@angular/core';
@Component({
selector: 'app-root',
template: `<p class="today">
本日は、{{today | date}} だ
</p>
`,
styles: [`
.today{background-color:yellow}
`]
})
export class AppComponent {
today = Date.now();
}
import {BrowserModule} from '@angular/platform-browser';
import {NgModule, LOCALE_ID} from '@angular/core';
import {AppComponent} from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule],
providers: [{provide: LOCALE_ID, useValue: 'ja-JP'}],
bootstrap: [AppComponent]
})
export class AppModule {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment