Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

No option for previous year? #28

Open
Ahnaf opened this issue Jan 31, 2021 · 3 comments
Open

No option for previous year? #28

Ahnaf opened this issue Jan 31, 2021 · 3 comments

Comments

@Ahnaf
Copy link

Ahnaf commented Jan 31, 2021

In live demo I did not find option for previous year, for example, to input Date of Birth.

@muarachmann
Copy link
Contributor

In live demo I did not find option for previous year, for example, to input Date of Birth.

If you are talking about navigating to previous years, see this https://vue-tailwind-picker.netlify.app/options/#star-date
To determine the start date, the previous date will be disabled

@kafk3d
Copy link

kafk3d commented Mar 6, 2021

Well, how to enable navigation to previous dates?
Also, is there some guide how to change translate/local/lang?

@kafk3d
Copy link

kafk3d commented Mar 7, 2021

Okay, I found a solution,
Import picker directly to project resources and make some changes in core
To enable previous date set startDate:

import VueDatePicker from './vue-tailwind-picker'
    export default {
        components: {
            VueDatePicker
        },
        data(){
            return {
                startDate: '2019-01-01',
                checkin: '',
            }
        }
    }

Then look into core mounted() hook (vue-tailwind-picker.vue) and add few lines to set current date to now:

mounted() {
            if (this.init) this.emit();
            this.changePicker(dayjs(new Date()));
            this.showPicker = !this.showPicker
        },

To change locale go to vue-tailwind-picker.vue and add this lines:

import * as locale from 'dayjs/locale/ru'
dayjs.locale(locale)

I'm not sure if it is professional solving, but it works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants