I have a strange situation.
I a page with ui-grid I see that the column header will be localized in correct way but date inside page not. I make an example: page are setted in italian 1 load page show my header in intlian but row show me date in English (I check that abp language var are in italian) 2 load i do with f5 row are localized in italian
I see a similar issue on a pop up when I inject agular-datetime-picker via oclazyload and i solve put on 1st row
moment.locale(abp.localization.currentLanguage.name);
I think depend off some angular problem but I'm not sure any idea or similar issue? mat
3 Answer(s)
-
0
Hi,
Can you try the check value of "moment.locale()" when grid is not showing correct datea for italian language ? And can you send me the grid column definition for that date column ?
I want to reproduce the problem.
Thanks.
-
0
Hi
to solve this issue I use this code
if (abp.localization.currentLanguage.name !== moment.locale()) { moment.locale(abp.localization.currentLanguage.name); console.log(moment.locale()); }
in a ui-grid I don't have anything of strange { name: abp.localization.tmk('HolidayStart'), field: 'holiday.from', cellFilter: 'momentFormat:'llll'', width: '*' },
and is in english format
in a modal I do the same fix with code on second row of js
moment.locale(abp.localization.currentLanguage.name);
-
0
Hi,
Normally momentjs's localization is set in layout.cshtml (since you are using SPA version) by this line.
moment.locale('@Thread.CurrentThread.CurrentUICulture.Name'); //Localizing moment.js
can you put a breakpoint and see the value of Thread.CurrentThread.CurrentUICulture.Name ?