javascript - XDSOFT plugin datimepicker Issue -


i'm using xdsoft datetimepicker plugin, found here: http://easycodestuff.blogspot.in/2016/01/using-date-time-pickers-in-angularjs.html (very useful , informative blog) , have set mintime, mindate 0 mean current date, time can selected. fine today , allowed set future time now. setting mintime 0 future dates , making select current time future date.

here demo plunker: http://plnkr.co/edit/vthuaraxak3ov4naa5tz?p=preview. here can select today's date , current time if select tomorrow's date i'm allowed select current time tomorrow.

i need solution time can selected future date.

also when date selected, manually entry still enabled,which means though mindate set 0, can select past dates. how disable once selected?

will thankful if can help.

i have created function("onchangedatetime") check date , set time validation.

try code, working plunker.

<!doctype html> <html>     <head>         <link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css" />         <script type="text/javascript" src="jquery.js"></script>         <script type="text/javascript" src="jquery.datetimepicker.full.js"></script>         <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>     </head>     <body>         <h3>datetimepicker</h3>         <input type="text" id="datetimepicker" onkeypress="return false" onpaste="return false"/>         <br /><br />          <script>                 var d = new date();             var logic = function( currentdatetime ){                 if(d.getfullyear() + '-' + d.getmonth() + '-' + d.getdate() == currentdatetime.getfullyear() + '-' + currentdatetime.getmonth() + '-' + currentdatetime.getdate() ){                     this.setoptions({                         mintime:0                     });                 }else{                   this.setoptions({                         mintime:'0:00'                   });                 }             };              $('#datetimepicker').datetimepicker({                 mindate: 0,                 onchangedatetime:logic,                 onshow:logic             });          </script>     </body> </html>  

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -