Skip to content

Conversation

@ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Dec 23, 2024

Resolves

Currently all the function from date module returns required server rendered global variables like

window.dayNames

This PR allows to use these functions outside the server render context (apps) using Intl, for example:

  • Web-Browser workers
  • Documentations
  • Talk Desktop

Drawbacks:

  • firstDay is not available on Firefox
  • Intl weekday in narrow format is different from dayNamesMin

Alternatives

  1. Add an init method to set these variables with the same Intl values
  2. Do nothing, this is not a real problem

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme added type: enhancement 🚀 New feature or request 3. to review 3️⃣ Waiting for reviews labels Dec 23, 2024
@ShGKme ShGKme requested review from skjnldsv and susnux December 23, 2024 16:16
@ShGKme ShGKme self-assigned this Dec 23, 2024
@ShGKme ShGKme mentioned this pull request Dec 23, 2024
6 tasks
Copy link
Contributor

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

🫡

Nice tests too!! 🎉

@susnux susnux merged commit 0624cb7 into main Jan 10, 2025
13 checks passed
@susnux susnux deleted the feat/date--fallback-to-Intl branch January 10, 2025 07:43
@susnux susnux mentioned this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review 3️⃣ Waiting for reviews type: enhancement 🚀 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants