Skip to content

feat(VDatePicker): restore weekday-format #21290

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 2 commits into from
May 19, 2025

Conversation

J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Apr 20, 2025

Description

weekdayFormat existed in v2, but was not yet re-implemented.

Note: It is going to be ignored by custom date adapters until those packages get updated by community.

  • date-fns is already printing with EEEEEE which equals to Intl's short
  • day.js has dd hardcoded - i.e. narrow
  • luxon uses Intl with short hardcoded

Markup:

<template>
  <v-container>
    <v-select
      label="Locale"
      variant="outlined"
      v-model="locale.current.value"
      :items="['en', 'de', 'pl', 'fr', 'ar']"
    />
    <v-date-picker
      :key="locale.current.value"
      class="mt-3"
      weekday-format="short"
    />
  </v-container>
</template>

<script setup>
  import { useLocale } from 'vuetify'
  const locale = useLocale()
</script>

@J-Sek J-Sek force-pushed the feature/weekday-format branch from da0a08c to f2e2230 Compare April 20, 2025 19:09
@J-Sek J-Sek self-assigned this Apr 20, 2025
@J-Sek J-Sek added T: feature A new feature C: VDatePicker E: date i18n Internationalization issue labels Apr 20, 2025
@J-Sek J-Sek requested a review from johnleider April 20, 2025 19:16
Copy link
Member

@johnleider johnleider left a comment

Choose a reason for hiding this comment

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

We might need to operate under the idea that other libraries aren't going to update and support this in the future.

@J-Sek J-Sek force-pushed the feature/weekday-format branch from f2e2230 to 32e4eac Compare May 14, 2025 10:18
@J-Sek
Copy link
Contributor Author

J-Sek commented May 14, 2025

We might need to operate under the idea that other libraries aren't going to update and support this in the future.

Devs can extend adapters to force particular weekday format or make it support new arguments by copy/pasting from the date-io PR linked above.

@J-Sek J-Sek requested a review from johnleider May 14, 2025 15:32
@johnleider
Copy link
Member

Devs can extend adapters to force particular weekday format or make it support new arguments by copy/pasting from the date-io PR linked above.

Is this something worth putting into an alert in the docs?

@J-Sek
Copy link
Contributor Author

J-Sek commented May 16, 2025

Is this something worth putting into an alert in the docs?

Alert.. not really. More like a full blog post to cover differences & limitations. For now we have the disclaimer at the end of the prop description in API docs and I feel it is fine. People are asking for help with their specific adapters from time to time, so I guess we'll see their voices on Discord. You could touch on it in v3.8.6 announcement with something like "week format supported by default date adapter, see [issueID] for more details"

IMO, getting built-in adapter better (and extendable: #21252) makes it easier for devs to achieve expected i18n goals without having to use 3rd party libraries.

@J-Sek J-Sek merged commit 13cfd9f into vuetifyjs:master May 19, 2025
10 checks passed
@J-Sek J-Sek deleted the feature/weekday-format branch May 19, 2025 19:53
@KaelWD KaelWD added this to the v3.9.0 (Zealot) milestone May 21, 2025
KaelWD added a commit that referenced this pull request May 21, 2025
KaelWD pushed a commit that referenced this pull request May 21, 2025
@KaelWD
Copy link
Member

KaelWD commented May 21, 2025

Moved to dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDatePicker E: date i18n Internationalization issue T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants