Skip to content

Add Khmer(km) Locale Support #2713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 28, 2021
Merged

Add Khmer(km) Locale Support #2713

merged 9 commits into from
Nov 28, 2021

Conversation

seanghay
Copy link
Contributor

Closes #981

I opened an issue a while back, but the issue was temporary closed due to I was not available to do it.

Now I am again in need of Khmer locale inside date-fns. And I think other people need it too.

If anything doesn't seem right, please let me know. I'll make changes to fit your needs.

Thanks!

Copy link
Contributor

@tan75 tan75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this PR! 🙏

@tan75 tan75 mentioned this pull request Nov 24, 2021
16 tasks
@leshakoss leshakoss merged commit 66606e3 into date-fns:master Nov 28, 2021
@Trishanns
Copy link

Thank you and I ask you to keep my hello world going on. Thank you Patricia Collier pcollier743@gmail.com

@seanghay seanghay deleted the locale/km branch December 16, 2021 06:41
tan75 pushed a commit to janziemba/date-fns that referenced this pull request Dec 27, 2021
@Kokleng-Dev
Copy link

Closes #981

I opened an issue a while back, but the issue was temporary closed due to I was not available to do it.

Now I am again in need of Khmer locale inside date-fns. And I think other people need it too.

If anything doesn't seem right, please let me know. I'll make changes to fit your needs.

Thanks!

Hello bong, i still can not get khmer language, i use version "date-fns": "^4.1.0".
Thank you.

@seanghay
Copy link
Contributor Author

seanghay commented Apr 7, 2025

@Kokleng-Dev share you code snippet here.

@Kokleng-Dev
Copy link

share you code snippet here.

Here you go, Bong!
I'm using shadcn-vue in my Nuxt.js project.

<Calendar
          v-model="model"
          :year="selectedYear"
          :month="selectedMonth + 1"
          initial-focus
          class="p-0"
          locale="km-KH"
        />

I checked it — they're using date-fns.
I tested it, and it works fine with other languages, but not with Khmer.

  1. france (fr-FR)
Screenshot 2025-04-07 at 1 12 12 in the afternoon
  1. chinese (zh-CN)
Screenshot 2025-04-07 at 1 13 32 in the afternoon
  1. thai (th-TH)
Screenshot 2025-04-07 at 1 13 52 in the afternoon
  1. khmer (km-KH) not work.
Screenshot 2025-04-07 at 1 14 16 in the afternoon

@seanghay
Copy link
Contributor Author

seanghay commented Apr 7, 2025

@Kokleng-Dev Looks like shadcn-vue uses reka-ui uses @internationalized/date which uses Intl.DateTimeFormat (not supported Khmer) not date-fns.

https://github.com/unovue/reka-ui/blob/v2/packages/core/src/date/calendar.ts#L40

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Khmer language support
5 participants