Location aware formatting?

オープン
#702 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
elixir

調査の方向性

Timex.Format.DateTime.Formatters.Default のドキュメントと、この issue で説明されている locale 関連の動作から始め、その後、言及されている ex_cldr および ex_cldr_dates_times プロジェクトと比較してください。Timex が locale に対応した短い日付のフォーマットをサポートできるかどうか、また要求された locale 互換性がどのように機能すべきかを明らかにできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hi! I can't find on the documentation if Timex is capable of doing something like this:

new Date().toLocaleString('en', {year: 'numeric', month: 'numeric', day: 'numeric'})
// >> '1/20/2022'
new Date().toLocaleString('pt-BR', {year: 'numeric', month: 'numeric', day: 'numeric'})
// >> '20/01/2022'

I see that many directives are documented in the Timex.Format.DateTime.Formatters.Default page, but I can't find a non-hard-coded way of defining a short date formats like this that are aware of the user's locale.

PS.: I've seen people in the community recommending ex_cldr and ex_cldr_dates_times, but the locales are not "compatible" with Timex. For instance, there's no pt-BR locale, only pt and pt-PT (https://github.com/elixir-cldr/cldr/issues/42), the first one being the "correct" format according to the spec they are following, which makes interop kind of a PITA tbh since we are storing Timex locales.

主要言語
Elixir
スター
1.8k
フォーク
408
平均マージ
2時間 8分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bitwalker/timex のほかの issue

bitwalker/timex の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。