V-calendar: Pick Month and Year only ( without selecting a date)

Created on 10 Mar 2018  路  18Comments  路  Source: nathanreyes/v-calendar

In my case, I want users to select month and year only. (the date always be on first of the month.)
Is it possible to allow user to select month and then year, without showing date?

Month and Year Picker

Thank you

enhancement

Most helpful comment

Just an update here...I'd like to stabilize the plugin before adding any more features, but I do think this will be a good one to add.

All 18 comments

Just an update here...I'd like to stabilize the plugin before adding any more features, but I do think this will be a good one to add.

+1

For good UX i would start with a scrollable year list instead of clicking left/right and then selecting a month.

@nathanreyes have you done implementing it?

I just wonder, are there any updates on this question?

Do you have this feature available? We need it! Thanks!

Sometimes we need only pick year, can this be an option?

Are there some news about it? I really need it...
Its a good feature.
Tks

@nathanreyes have you done implementing it?

This option is implementing ?
If yes, how to setup this option ?
Thx,

@rifton007 you just have to play around with the format and value-format.
Below code should work.

Month and Year picker
` v-model="datePicker"
format="MMMM-yyyy"
value-format="MM-yyyy"
type="month"
placeholder="Select Month & Year"

`

Year picker
` v-model="datePicker"
format="yyyy"
value-format="yyyy"
type="year"
placeholder="Select Year"

`

Thx @ajithsimon
Can you check, because it doesn't work for me ?

v-calendar 1.0.6

<vc-date-picker
:popover="{ visibility: 'click', placement:'top' }"
:input-props="{
placeholder: 'Date de fin',
class : 'form-control rounded-0'
}"
v-model="draft.endDate"
format="yyyy"
value-format="yyyy"
type="year"
/>

@rifton007 This was working code from my project. I tested and shared it with you..
draft.endDate have only year right?

Hi @ajithsimon I tried the two cases : value-format="yyyy" and value-format="MM-yyyy". It isn't working for me, no changing of datepicker.

I have version 1.0.8
This option doesn't work for me

<vc-date-picker
    :popover="{ visibility: 'click' }"
    :input-props="{
        class : 'form-control rounded-0'
    }"
    v-model="draft.endDate"
    format="yyyy"
    value-format="yyyy"
    type="year"
/>

@rifton007 you just have to play around with the format and value-format.
Below code should work.

Month and Year picker
<el-date-picker v-model="datePicker" format="MMMM-yyyy" value-format="MM-yyyy" type="month" placeholder="Select Month & Year" ></el-date-picker>

Year picker
<el-date-picker v-model="datePicker" format="yyyy" value-format="yyyy" type="year" placeholder="Select Year" ></el-date-picker>

This solution is for Element-UI date-picker https://element.eleme.io/#/en-US/component/date-picker. v-calendar component starts with "vc-date-picker" and not "el-date-picker"

I'll like to see this feature available in v-calendar though.

I would like to see this as well!

This would be a great feature to have on this project. Is there any progress or expected launch of this?

Beautiful plugin. I wish this was implemented, I'll have to find another plugin because I don't have time to implement a month/year only picker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hanhtv204 picture hanhtv204  路  4Comments

bocanhcam picture bocanhcam  路  3Comments

maksnester picture maksnester  路  3Comments

redraw picture redraw  路  3Comments

thfontaine picture thfontaine  路  3Comments