Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Enable passing `formatStyle` to Intl.DateTimeFormat

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript

調査の方向性

src/relative-time-element.ts の参照されている 173 行目付近と 188 行目付近から始め、既存の Intl.RelativeTimeFormat の設定を Intl.DateTimeFormat と比較してください。timeStyle と dateStyle に関するリンク先の MDN ガイダンスを読み、そのうえで、今日の場合と後の日付の場合にコンポーネントがこれらのオプションをどのように公開すべきかを判断してください。完了条件は、呼び出し側がコンポーネント API を通じて要求された時刻スタイルと日付スタイルを設定できることです。

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

説明

Here A style argument is being passed to the config of the Intl.RelativeTimeFormat constructor.

But Here There's no way to configure the timeStyle or dateStyle properties as described in the MDN docs below:

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

We have a use case where for DateTime's fitting within the users "today" we only want to display the timeStyle: 'short', but for DateTimes after today we only want to display the dateStyle: 'short' and with the current api I'm not sure how exactly to go about that 🤔

主要言語
JavaScript
スター
4k
フォーク
194
平均マージ
4日 10時間
マージ済み PR(30日)
5

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

github/relative-time-element のほかの issue

github/relative-time-element の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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