2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

angularx-flatpickrでlocaleを日本語に変更する

Last updated at Posted at 2020-01-08

Angularで使えるDatePicker(=angularx-flatpickr)のLocaleのデフォルトが英語圏なので、日本語に変更します。

前提

angularx-flatpickrが導入されていること

AnyComponent.ts


import { Component, OnInit } from '@angular/core';
import flatpickr from 'flatpickr';
import { Japanese } from 'flatpickr/dist/l10n/ja.js';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
})
export class AnyComponent implements OnInit {
  constructor() {
    flatpickr.localize(Japanese);
  }
}

Before

image.png

After

image.png

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?