how to set date in date picker as per the year and date [Resolved]

Posted by Manorama under ASP.NET MVC on 11/10/2016 | Points: 10 | Views : 1383 | Status : [Member] | Replies : 1
hi to all,
I am using boostrap date picker.Here iam unable to findout the solution for my issue,the thing is:i have to set renewal date as :2017/july/10;If system date is 2017jan10th boostrap date picker shows same date as 2017july10th,once system date is crossed 2017july10th boostrap datepicker automatically update its time to to set smart date range.please guide me.
thank you in advance.



Posted by: Rajnilari2015 on: 11/10/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50


Try this

<!DOCTYPE html>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<script type="text/javascript" src=""></script>
<script type='text/javascript'>
$('#divTestDtPicker input').datepicker({
autoclose: true

$('#divTestDtPicker input').on('show', function(e){
console.debug('show',, $(this).data('stickyDate'));

if ( ) {
else {
$(this).data('stickyDate', null);

$('#divTestDtPicker input').on('hide', function(e){
console.debug('hide',, $(this).data('stickyDate'));
var stickyDate = $(this).data('stickyDate');

if ( ! && stickyDate ) {
console.debug('restore stickyDate', stickyDate);
$(this).datepicker('setDate', stickyDate);
$(this).data('stickyDate', null);

<div id="divTestDtPicker">
<input type="text" type="text" class="form-control" />

Thanks & Regards,
RNA Team

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response