How to turn off the time selection in the bootstrap datepicker? - html

I've embed a bootstrap datepicker from http://www.malot.fr/bootstrap-datetimepicker/demo.php
I want only the date and month and year to be displayed. But in this plugin I've date,month,year, and time. How do I remove only the time selection from this datepicker?

Use DatePicker instead of DateTimePicker.

I use a different datetime picker, and have had great success with it. Bootstrap 3 Date/Time Picker. It uses Moment.js and allows for all sorts of date/time formatting options. It is also more accessible, and allows for scrolling through the calendar and time option using a keyboard.
Using the plugin I suggested, the format for just the date would be:
$('.formDate').datetimepicker({
format: 'MM/DD/YYYY'
});

Related

Primefaces DatePicker Range Selection with Time

We use a DatePicker component in our project. Primefes Version 10.
<p:datePicker id="range" selectionMode="range" showTime="true" />
Period selection works great:
The selected period will be deleted when I change the time.
Is it possible to use Date Range Picker with a Time?
Currently that is not available but has been requested on GitHub. I suggest you go upvote the issue there.
See Issue: https://github.com/primefaces/primefaces/issues/5037

How to keep open a materialize datepicker on blur?

Problem:
I am using upgraded materialize date picker(version 1.0.0) and I want my date-picker calendar to remain open on clicking outside the calendar. Thanks in Advance.
What I have tried:
Firstly, I have tried.
picker.set('select', new Date());
But it also closes the date picker because, if the date is selected, then it is not closing the date picker on clicking the header of the modal, but if we are not initializing the date picker then it closes the date picker on clicking the modal's header.
If the date picker use model than use the following code.
$('.modal').modal({backdrop: 'static', keyboard: false})

Yii2 full calendar custom button?

I'm trying to add a custom button into yii2 full calendar, but doesn't work for me.
Basically, I want to include a button as part of the full calendar view, i.e., next to the month and date. This button should be to the left of the calendar header.
I'm using customButton from Full Calendar, but this doesn't work.
Thanks for any help.
Support for customButtons is supported in version 2.4.0. Make sure you're using this version or higher.

How to hide "clear" button in Safari's native date picker?

I have a non-nullable date field which I present in the following HTML element:
<input type="date" value="(enter date value here)"/>
By default there will always be a date in this field. However, iOS's native datepicker comes with the ability to clear the date.
There's code to validate on both the client and server that this field cannot be empty. Still, I'd rather not have this button shown at all to the user.
Is there a way I can hide it, using a special attribute or something? I don't care if the solution is targetted at iOS's Safari only.
When the dateTimePicker is called, you could try and add a UIView over the picker with the appropriate background color to hide the button.
Alternatively, consider that 'clear' in the context of your app could mean 'clear what the user has selected to let them start fresh.' If they hit the clear button, just insert today or whatever date you want as a default date.

HTML Input Type Date - Select and Collapse

When using an input type date in HTML5, after the user clicks on a date, the calendar stays expanded forcing them to click away from the calendar to make it collapse. I'd like for this to happen in a single click (i.e. when they click on the calendar, the date is recorded, the calendar collapses and they can get on to other business). Can anyone tell me how to do this? Thanks!
<label>Date</label>
<input type="date" id="my_date">
You could do it by using a jQuery plugin such as datepicker from jQuery UI:
http://jqueryui.com/datepicker/
You could also use webshims, which polyfills incapable browsers and gives you nice custom widgets on top of HTML5 form inputs. Here is a demo, which includes some examples with different configurations.
webshims.polyfill('forms forms-ext');