Open hryktrd opened 4 years ago
Hi, Have you tried setting locale at your app level instead of a specific component?
I tried setting locale at app.component.ts by receiving your message, but it still don't change to Japanese.
my import section in app.component is follows
import { AmplifyService } from 'aws-amplify-angular';
import * as moment from 'moment';
import 'moment/locale/ja';
moment.locale('ja');
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
Thank you.
Hi, Have slimier problem so i fork and added the locale support feature.
@balgopal14 Hi, Do you have repository that soluted this problem? I saw your profile but I couldn't find your repository that forked from this repository. Do you have it in private repository? If you can share source code, could you show me it?
Thank you.
@balgopal14 Sorry, I was overlooking your pull request. I'll try to change locale by using your repository. https://github.com/habilelabs/multiple-date-picker-angular
Thank you.
@hryktrd
Just set the locale parameter in multi-date-picker like this
<multiple-date-picker [locale]="locale">
It will change the language of date picker.
@balgopal14 Thank you, very much.
When I tried it, I could change the locale to ja, but I could change the locale only on the day of the week. Do you know how to change the month locale?
Hi @hryktrd, It changing the locale of month as well in my end. Could you please try to check this on page reload.
Hi. @balgopal14 I tried to clear cache and page reload, but month's locale didn't change to japanese. Which locale do you use? I'll try to use locale same.
And my usage is follows
<multiple-date-picker
[(ngModel)]="holidays"
[fontAwesome]="true"
[disableDaysBefore]="true"
[disallowBackPastMonths]="true"
[sundayFirstDay]="true"
locale="ja"
></multiple-date-picker>
Thank you.
Hi, @hryktrd
I used this as a dynamic feature. screenshot is from "sv-SE" locale
Hi, @balgopal14 I tried locale that same as you, but month's locale didn't change...
I couldn't under stand that your part of comment 'dynamic feature'. What's mean of it? And your screenshot looks like different from my screen. I use multiple-date-picker by default design. Are you using it by any customize?
Thank you.
Hi, @balgopal14
I'm sorry to ask you many questions
Do you have any idea to change locale of name of month?
Thank you.
Hi, @balgopal14 I solute this problem by fix locale to japanese only.
In your code,
moment.locale(this.locale || 'en-US') //dynamic locale
is not effective to month's format, so I move it to under of
import * as moment from 'moment/moment';
but this.locale is undefined here, so I fix locale to 'ja'. https://github.com/hryktrd/multiple-date-picker-angular
I'd be happy if the locale could be dynamically set to include the month, but I think a big change is needed.
Thank you.
Hi, @hryktrd Yes right a big change is needed for month. I'm not sure why but somehow its working on my end.
Thank you.
Hi.
I use multiple-date-picker-angular on angular8 project. I want to change language to japanese day and month letter.
But, I wrote this in component that use date picker
it have no effect.
And then, I wrote this in dist/multiple-date-picker.component.js directly,
under require moment. letters of month and day are changed to japanese.
Any other way to change locale?
Thank you.