JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › dateInput how to apply locale?
- This topic has 5 replies, 2 voices, and was last updated 2 years ago by
ivanpeevski.
-
AuthorPosts
-
August 3, 2023 at 7:19 am #108512
innosoft
ParticipantI’m make locale message script
<div>export const messages = {
ko:{
“firstDay”: 1,
“days”: {
“names”: [
“월요일”,
“화요일”,
“수요일”,
“목요일”,
“금요일”,
“토요일”,
“일요일”
],
“namesAbbr”: [
“월”,
“화”,
“수”,
“목”,
“금”,
“토”,
“일”
],
“namesShort”: [
“월”,
“화”,
“수”,
“목”,
“금”,
“토”,
“일”
]
},
“months”: {
“names”: [
“1월”,
“2월”,
“3월”,
“4월”,
“5월”,
“6월”,
“7월”,
“8월”,
“9월”,
“10월”,
“11월”,
“12월”,
“”
],
“namesAbbr”: [
“1월”,
“2월”,
“3월”,
“4월”,
“5월”,
“6월”,
“7월”,
“8월”,
“9월”,
“10월”,
“11월”,
“12월”,
“”
]
},
“AM”: [
“오전”,
“오전”,
“오전”
],
“PM”: [
“오후”,
“오후”,
“오후”
],
}
}</div>
How to apply “editor: ‘dateInput'”?August 3, 2023 at 11:17 am #108513ivanpeevski
ParticipantHi innosoft,
It is enough to set the locale of the date input to ‘ko’, as the component uses the Intl.DateTimeFormat JS object to correctly translate all date titles.
Here is an example – codepen
<span class=”im”>Best Regards,
Ivan Peevski
Smart UI Team
https://www.htmlelements.com/</span>August 4, 2023 at 1:45 am #108515innosoft
ParticipantThe full name of the day is truncated.
the exact expression is
Sunday => 일요일
Monday => 월요일
Tuesday => 화요일
Wednesday => 수요일
Thursday => 목요일
Friday => 금요일
Saturday => 토요일But on the calendar
Sunday => 일요
Monday => 월요
Tuesday => 화요
Wednesday => 수요
Thursday => 목요
Friday => 금요
Saturday => 토요I tried according to the codepan, but it doesn’t work
I want to replace day names
names: [“월”,
“화”,
“수”,
“목”,
“금”,
“토”,
“일”
],-
This reply was modified 2 years ago by
innosoft.
August 4, 2023 at 8:57 am #108517ivanpeevski
ParticipantHi innosoft,
You can use the calendar’s “dayNameFormat” to set in what format to display the week names.
Here is an example with full name – codepen
And an example with only one character – codepen
Ivan Peevski
Smart UI Team
https://www.htmlelements.com/August 7, 2023 at 8:18 am #108521innosoft
Participantthank you
It works.one more question…
Can I change the format to ‘yyyy-MM-dd’ when selecting a date in the calendar?
I set ‘cellsFormat’ to ‘yyyy-MM-dd’ in the grid column setting, but the ‘cellsFormat’ setting is not applied when I select a date from the calendar.
-
This reply was modified 2 years ago by
innosoft.
August 7, 2023 at 10:12 am #108523ivanpeevski
ParticipantHi innosoft,
You should set the “editor.settings.formatString” property.
Here is an example – codepen
Ivan Peevski
Smart UI Team
https://www.htmlelements.com/ -
This reply was modified 2 years ago by
-
AuthorPosts
- You must be logged in to reply to this topic.