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
Kalyani Shevale
NA
3.2k
711.5k
how get Two date Diff in jquery
Jul 5 2019 4:31 AM
I have Used two date using datepicker .how to calculate date difference in jquery.
I have applied blow code but in that, the code I want 3 days to count using the form to date that time count will be 2 displayed.
@Html.TextBoxFor(m => m.fromDate,
new
{ @
class
=
"form-control"
, @placeholder =
"From Date"
, @id =
"fromDate"
})
@Html.TextBoxFor(m => m.toDate,
new
{ @
class
=
"form-control"
, @placeholder =
"To Date"
, @id =
"toDate"
})
$(
"#fromDate"
).datepicker({
minDate: 0,
maxDate:
'+0Y+1M'
,
onSelect: function (dateStr) {
var min = $(
this
).val();
}
});
$(
"#toDate"
).datepicker({
minDate:
'0'
,
maxDate:
'+0Y+1M'
,
onSelect: function (dateStr) {
debugger;
var max = $(
this
).val();
// Get selected date
var start = $(
"#fromDate"
).val();
var end = $(
"#toDate"
).val();
var days = Math.round(Math.abs((
new
Date(end) -
new
Date(start)) / (1000 * 60 * 60 * 24)));
$(
"#TextBox3"
).val(Math.round(days));
}
});
please help
I want data that like..
01/07/2019 TO 03/07/2019 Totals days =3
Reply
Answers (
2
)
how to redirect div in another page with same domain?
Could not able use jquery functions in Angular 6