Skip to content
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

Incorrect month formatting #881

Closed
exi66 opened this issue May 28, 2024 · 1 comment · Fixed by #882
Closed

Incorrect month formatting #881

exi66 opened this issue May 28, 2024 · 1 comment · Fixed by #882
Labels
bug Something isn't working

Comments

@exi66
Copy link
Contributor

exi66 commented May 28, 2024

Describe the bug
Month string uses incorrect formatting from date-fns. Currently, to display the month in month-picker, number-dependent formatting is used, so the line with months looks as if it actually contains the first day of the month, which is incorrect.

To Reproduce

<script lang="ts" setup>
    import { ref } from 'vue';
    import Datepicker from '../src/VueDatePicker/VueDatePicker.vue';
    import { ru } from 'date-fns/locale';

    const selectedMonth = ref();
</script>

<template>
    <!-- Example -->
    <div class="wrapper">
        <Datepicker v-model="selectedMonth" month-picker :format-locale="ru" placeholder="Select Date" />
    </div>
    <!--
        inside the interface May (май in russia) look like this
        ----
        мая
        ----
        but the correct way should be:
        ----
        май
        ----
    -->
</template>

<style lang="scss">
    @import 'src/VueDatePicker/style/main';
    .wrapper {
        padding: 200px;
    }
</style>

Expected behavior
data-fns has the correct Month Format (Standalone) value, which looks like LLL or LLLL.
https://date-fns.org/v2.16.1/docs/format

Desktop & mobile (please complete the following information):

  • Any browser
  • Library version v8.7.0
@exi66 exi66 added awaiting triage The issue is not reviewed by the maintainers bug Something isn't working labels May 28, 2024
@Jasenkoo Jasenkoo removed the awaiting triage The issue is not reviewed by the maintainers label May 29, 2024
@Jasenkoo
Copy link
Contributor

I will keep it open for now, until the new version. Tnx for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants