TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
476.2k
How to create a correct date format in bootstrap date-picker
Jan 9 2020 2:00 AM
Hi Team
I want to create this format on bootstrap date-picker.e.g 08/01/2020. Mine show this format on the form,eg. 01/08/2020(which is not correct from the form when date is selected) Here is my code for this logic.
<link rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker3.min.css"
>
<script type=
'text/javascript'
src=
"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.min.js"
></script>
<!---DatePicker
for
startDate and endDate. ---->
<div
class
=
"d-flex justify-content-start"
>
<div
class
=
"col-xl-10.5 col-lg-10.5 col-md-10 col-sm-10.5 col-10.5"
>
<div
class
=
"input-daterange input-group"
id=
"datepicker"
>
<input type=
"text"
class
=
"input-sm form-control"
name=
"from"
placeholder=
"startdate"
/>
<span
class
=
"input-group-addon"
>To</span>
<input type=
"text"
class
=
"input-sm form-control"
placeholder=
"enddate"
/> </div> </div> </div><br>
// date functionality
$(document).ready(
function
()
{
var
year = (
new
Date).getFullYear();
$(
'.input-daterange'
).datepicker({ dateFormat:
"dd-mm-yy"
, autoclose:
true
, minDate:
new
Date(year, 0, 1), maxDate:
new
Date(year, 11, 31) });
});
Reply
Answers (
3
)
Set up the Selenium with Visual Studio
How to create a unique iframe when you have side by side one