Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
10872 มุมมอง

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 19
9810
1
พ.ค. 16
4663
3
มี.ค. 25
3830
0
พ.ย. 22
2462
1
ก.ค. 24
36