Intl 과 날짜포맷 #589
Henry-Hong
started this conversation in
Today I Learned
Intl 과 날짜포맷
#589
Replies: 2 comments 2 replies
-
|
오 이런 메서드가 있군요!ㅎㅎㅎ |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
글로벌 서비스를 하고 계신가봐요!? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Intl.DateTimeFormat(locale, {dateStyle: 'medium'}).format(date);
여기서 dateStyle 에 따라 정밀도? 를 조절할 수 있다.
글로벌 서비스를 이용중이라면, PM/designer와 협의해서, Intl을 활용하면 포매팅에 신경안써도 되어서 좋을것 같다.
'short' - 가장 간단한 형식
🇺🇸 en-US: 1/17/25
🇰🇷 ko-KR: 25. 1. 17.
'medium' - 중간 상세도 (월 이름 축약)
🇺🇸 en-US: Jan 17, 2025
🇰🇷 ko-KR: 2025. 1. 17.
'long' - 긴 형식 (월 이름 전체)
🇺🇸 en-US: January 17, 2025
🇰🇷 ko-KR: 2025년 1월 17일
'full' - 가장 상세한 형식 (요일 포함)
🇺🇸 en-US: Friday, January 17, 2025
🇰🇷 ko-KR: 2025년 1월 17일 금요일
Beta Was this translation helpful? Give feedback.
All reactions