コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
10899 ビュー

Hi all,

how can I use datepicker in a Date field?
I try to disable past dates like that:

<field class="delivery_date" name="delivery_date" options="{'datepicker':{'minDate': 0}}"/>

But past dates are shown nevertheless.

Thanks in advance!

アバター
破棄

I know it's been a year but have you found a solution? 

著作者

Hi Yannick. No unfortunately not..

最善の回答

Yes, you can disable the paste dates but it cannot be done with any widget or options.

You will have to override the date picker library in JS and disable the paste dates. You will have to make the following change here:

minDate: new Date();

Either you can override the JS and make the change or you can directly change in the JS code in the base module.

アバター
破棄
最善の回答

Hello, you can use:


<field name="date_invoice" options="{'datepicker': {'warn_future': true}}"/>
show only future dates.
アバター
破棄
著作者

Hi GiusyG,

thanks for your help. Unfortunately this is not working as well. It seems to me that the "options" part is not parsed in a way. So whatever options I use, it has no effect.

Do you or does anyone know what's wrong there?

This doesn't work sir.

関連投稿 返信 ビュー 活動
1
12月 19
9830
1
5月 16
4675
3
3月 25
3851
0
11月 22
2478
1
7月 24
36