Hide or lock calendar Sab/gift

Asked

Viewed 245 times

0

Hello, in my form I created a calendar with the tag input type=date in my html, I blocked the 3 days from the current date and would like to block Saturdays and Sundays to display only weekdays of the week, someone knows how to do or has some tip on how to do?

Follow what I’ve done so far:

Add 3 days to date

$data = date('Y-m-d', strtotime('+3 days', strtotime(date('Y-m-d'))));

simplified html

<input type="date" id="venc_via2" name="venc_via2" min="<?= $data; ?>">

Grateful for the attention.

  • 1

    It is not using any framework, but most of them come with a function that searches the days of the week (from 0 until 6), being 0-Sunday and 6-Saturday. In JS it would look like this answer: https://stackoverflow.com/questions/49863189/disable-weekends-on-html-5-input-type-date

  • 1

    @Edwardramos thanks, worked the way I want.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.