Datetimepicker unable to select the todaydate
Datetimepicker unable select today's date.Suppose When we open the datetimepicker and change the date and select the today date it is not selected.And we used the Bootstarp datetimepicker.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY",minDate:new Date()});
Thank you.
jquery datetimepicker bootstrap-datetimepicker
add a comment |
Datetimepicker unable select today's date.Suppose When we open the datetimepicker and change the date and select the today date it is not selected.And we used the Bootstarp datetimepicker.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY",minDate:new Date()});
Thank you.
jquery datetimepicker bootstrap-datetimepicker
try this code:-$('#datetimepicker1').datetimepicker({format: "DD/MM/YYYY",startDate:new Date()});
– Mohit Kumar
Sep 7 '15 at 5:11
minDate:new Date()
allows you select today , can show your code where this is not working in a fiddle
– J Santosh
Sep 7 '15 at 11:36
add a comment |
Datetimepicker unable select today's date.Suppose When we open the datetimepicker and change the date and select the today date it is not selected.And we used the Bootstarp datetimepicker.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY",minDate:new Date()});
Thank you.
jquery datetimepicker bootstrap-datetimepicker
Datetimepicker unable select today's date.Suppose When we open the datetimepicker and change the date and select the today date it is not selected.And we used the Bootstarp datetimepicker.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY",minDate:new Date()});
Thank you.
jquery datetimepicker bootstrap-datetimepicker
jquery datetimepicker bootstrap-datetimepicker
asked Sep 7 '15 at 4:43
vamsi kr
2111211
2111211
try this code:-$('#datetimepicker1').datetimepicker({format: "DD/MM/YYYY",startDate:new Date()});
– Mohit Kumar
Sep 7 '15 at 5:11
minDate:new Date()
allows you select today , can show your code where this is not working in a fiddle
– J Santosh
Sep 7 '15 at 11:36
add a comment |
try this code:-$('#datetimepicker1').datetimepicker({format: "DD/MM/YYYY",startDate:new Date()});
– Mohit Kumar
Sep 7 '15 at 5:11
minDate:new Date()
allows you select today , can show your code where this is not working in a fiddle
– J Santosh
Sep 7 '15 at 11:36
try this code:-
$('#datetimepicker1').datetimepicker({format: "DD/MM/YYYY",startDate:new Date()});
– Mohit Kumar
Sep 7 '15 at 5:11
try this code:-
$('#datetimepicker1').datetimepicker({format: "DD/MM/YYYY",startDate:new Date()});
– Mohit Kumar
Sep 7 '15 at 5:11
minDate:new Date()
allows you select today , can show your code where this is not working in a fiddle– J Santosh
Sep 7 '15 at 11:36
minDate:new Date()
allows you select today , can show your code where this is not working in a fiddle– J Santosh
Sep 7 '15 at 11:36
add a comment |
4 Answers
4
active
oldest
votes
You are setting the minData
to new Data()
new Data()
by default gives the current data.
So In your case you are not able to select not only today's date but all the past date.
So simple remove the minData
parameter(as below), or use it a different way.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY"});
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday ismoment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
add a comment |
You have to integrade use Below code to select the todaydate
minDate: new Date().setHours(0,0,0,0)
$("#startdatetimepicker").datetimepicker({ minDate : new
Date().setHours(0,0,0,0),format: 'DD-MM-YYYY'});
- It select the today's date also after picked another date and go for select today's date.
- It's also disable the previous date.
add a comment |
You should use following code.
<script src="/assets/js/plugins/datetime/bootstrap-datetimepicker.min.js"></script>
$('#datetimepicker1').datetimepicker({
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
add a comment |
You're setting the minDate
to today, which means won't be able to select it.
Instead, set minDate
to minDate: moment().subtract(1,'d')
which will be yesterday.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f32431218%2fdatetimepicker-unable-to-select-the-todaydate%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
You are setting the minData
to new Data()
new Data()
by default gives the current data.
So In your case you are not able to select not only today's date but all the past date.
So simple remove the minData
parameter(as below), or use it a different way.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY"});
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday ismoment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
add a comment |
You are setting the minData
to new Data()
new Data()
by default gives the current data.
So In your case you are not able to select not only today's date but all the past date.
So simple remove the minData
parameter(as below), or use it a different way.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY"});
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday ismoment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
add a comment |
You are setting the minData
to new Data()
new Data()
by default gives the current data.
So In your case you are not able to select not only today's date but all the past date.
So simple remove the minData
parameter(as below), or use it a different way.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY"});
You are setting the minData
to new Data()
new Data()
by default gives the current data.
So In your case you are not able to select not only today's date but all the past date.
So simple remove the minData
parameter(as below), or use it a different way.
$('#datetimepicker1').datetimepicker().data("DateTimePicker").options({format: "DD/MM/YYYY"});
answered Sep 7 '15 at 5:04
sanjeev
2,83911023
2,83911023
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday ismoment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
add a comment |
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday ismoment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
In this case we able to select the previous dates too.So that's y we used the minDate.Is there any solution for this(Not select previous dates) @sanjeev
– vamsi kr
Sep 7 '15 at 5:09
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
stackoverflow.com/questions/5511323/javascript-yesterday
– sanjeev
Sep 7 '15 at 5:17
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday is
moment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
@vamsikr As the Datetimepicker uses Moment, the best way to get yesterday is
moment().subtract(1, 'day')
– P_S
Sep 7 '15 at 12:57
add a comment |
You have to integrade use Below code to select the todaydate
minDate: new Date().setHours(0,0,0,0)
$("#startdatetimepicker").datetimepicker({ minDate : new
Date().setHours(0,0,0,0),format: 'DD-MM-YYYY'});
- It select the today's date also after picked another date and go for select today's date.
- It's also disable the previous date.
add a comment |
You have to integrade use Below code to select the todaydate
minDate: new Date().setHours(0,0,0,0)
$("#startdatetimepicker").datetimepicker({ minDate : new
Date().setHours(0,0,0,0),format: 'DD-MM-YYYY'});
- It select the today's date also after picked another date and go for select today's date.
- It's also disable the previous date.
add a comment |
You have to integrade use Below code to select the todaydate
minDate: new Date().setHours(0,0,0,0)
$("#startdatetimepicker").datetimepicker({ minDate : new
Date().setHours(0,0,0,0),format: 'DD-MM-YYYY'});
- It select the today's date also after picked another date and go for select today's date.
- It's also disable the previous date.
You have to integrade use Below code to select the todaydate
minDate: new Date().setHours(0,0,0,0)
$("#startdatetimepicker").datetimepicker({ minDate : new
Date().setHours(0,0,0,0),format: 'DD-MM-YYYY'});
- It select the today's date also after picked another date and go for select today's date.
- It's also disable the previous date.
edited Nov 21 '18 at 12:50
answered Nov 21 '18 at 9:59
Aman Singh
112
112
add a comment |
add a comment |
You should use following code.
<script src="/assets/js/plugins/datetime/bootstrap-datetimepicker.min.js"></script>
$('#datetimepicker1').datetimepicker({
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
add a comment |
You should use following code.
<script src="/assets/js/plugins/datetime/bootstrap-datetimepicker.min.js"></script>
$('#datetimepicker1').datetimepicker({
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
add a comment |
You should use following code.
<script src="/assets/js/plugins/datetime/bootstrap-datetimepicker.min.js"></script>
$('#datetimepicker1').datetimepicker({
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
You should use following code.
<script src="/assets/js/plugins/datetime/bootstrap-datetimepicker.min.js"></script>
$('#datetimepicker1').datetimepicker({
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
edited Sep 7 '15 at 5:32
answered Sep 7 '15 at 4:51
Developer
1,52611221
1,52611221
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
add a comment |
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
Still unable to select the today date@Singh
– vamsi kr
Sep 7 '15 at 5:00
add a comment |
You're setting the minDate
to today, which means won't be able to select it.
Instead, set minDate
to minDate: moment().subtract(1,'d')
which will be yesterday.
add a comment |
You're setting the minDate
to today, which means won't be able to select it.
Instead, set minDate
to minDate: moment().subtract(1,'d')
which will be yesterday.
add a comment |
You're setting the minDate
to today, which means won't be able to select it.
Instead, set minDate
to minDate: moment().subtract(1,'d')
which will be yesterday.
You're setting the minDate
to today, which means won't be able to select it.
Instead, set minDate
to minDate: moment().subtract(1,'d')
which will be yesterday.
answered Sep 7 '15 at 16:48
Eonasdan
5,71964366
5,71964366
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f32431218%2fdatetimepicker-unable-to-select-the-todaydate%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try this code:-
$('#datetimepicker1').datetimepicker({format: "DD/MM/YYYY",startDate:new Date()});
– Mohit Kumar
Sep 7 '15 at 5:11
minDate:new Date()
allows you select today , can show your code where this is not working in a fiddle– J Santosh
Sep 7 '15 at 11:36