Vue2-datepicker: How to change format header

Created on 3 Jan 2019  Â·  5Comments  Â·  Source: mengxiong10/vue2-datepicker

image
default format header: 1月 2019
now i want to change format: 2019/1 , Please confirm how to change it?

Most helpful comment

v3.0.
You can set it by lang.

<date-picker  :lang="locale" />

```js
// import defalut locale.
import 'vue2-datepicker/locale/zh-cn';

export default {
date() {
return {
locale: {
yearFormat: 'YYYY /',
monthFormat: 'M',
monthBeforeYear: false,
},
};
},
};```

All 5 comments

Don't have prop to change it.
You just can change the language.

@mengxiong10
language only change text of label can not change format to display?
some cases we wana change format to display as yyyy/mm, mm/yyyy..
if have any idea please help to tell me !

You can switch position of year and months by css #223. But cann't format now.

You can switch position of year and months by css #223. But cann't format now.

Thank you, it's worked. but if you update to allow format is OK.

v3.0.
You can set it by lang.

<date-picker  :lang="locale" />

```js
// import defalut locale.
import 'vue2-datepicker/locale/zh-cn';

export default {
date() {
return {
locale: {
yearFormat: 'YYYY /',
monthFormat: 'M',
monthBeforeYear: false,
},
};
},
};```

Was this page helpful?
0 / 5 - 0 ratings

Related issues

srv91 picture srv91  Â·  6Comments

BuiHuyCuong picture BuiHuyCuong  Â·  5Comments

DragosPeta picture DragosPeta  Â·  3Comments

georgehrke picture georgehrke  Â·  4Comments

mhdyahiya picture mhdyahiya  Â·  5Comments