I have a text box using jquery date and time iam choosing a date and time so this will be in my text box 2014/06/11 18:50 On submit button i am calling a javascript
<asp:Button ID="bt_schedule" runat="server" CssClass="button" Text="Submit" OnClientClick="return btnSubmit_Click();"
OnClick="bt_schedule_Click" />
my requirement is date should be greater than and equal to today's date and time should be greater than 5 minute to current time. so i am using something like below
<script type="text/javascript">
function btnSubmit_Click() {
var strval = document.getElementById("<%= tb_calimage.ClientID %>").value;
var dateParts = strval.split(" ");
var date = dateParts[0];
var time = dateParts[1];
var datecompare = new Date(date);
var currentDate = new Date();
var sysdate = currentDate.getHours();
var systime = currentDate.getMinutes();
if (datecompare >= currentDate ) {
alert('Date greater than or equal t0 Today');
return false;
}
return true;
}
and also currentDate is showing date with time so i am not able to get it properly.. and also how to check with time. Please help