I am using this bootstrap date range picker. I want to change date format date to dd/MMM/yyyy
:
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/latest/css/bootstrap.css" /> <!-- Include Date Range Picker --> <script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script> <script type="text/javascript"> $(function() { $("#<%= txtName.ClientID %>").daterangepicker(); }); </script>
Press Ctrl+1 to open the Format Cells dialog. Alternatively, you can right click the selected cells and choose Format Cells… from the context menu. In the Format Cells window, switch to the Number tab, and select Date in the Category list. Under Type, pick a desired date format.
From the Insert drop-down menu, select Date/Time. Select the appropriate format. Click OK.
To set and get the input type date in dd-mm-yyyy format we will use <input> type attribute. The <input> type attribute is used to define a date picker or control field. In this attribute, you can set the range from which day-month-year to which day-month-year date can be selected from.
Display the current date and time in a date pickerClick the Data tab. In the Data type box, click Date and Time (dateTime). Click Format. In the Date and Time Format dialog box, in the Display the time like this list, click the option that you want, and then click OK.
If you want to present a different format, you need to add a locale object after you run the daterangepicker function. The site doesn't currently have a list of all the formats it supports, but try this:
$(function() { $("#<%= txtName.ClientID %>").daterangepicker({ locale: { format: 'DD/MMM/YYYY' } }); });
See here for more options: http://www.daterangepicker.com/#config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With