Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to validate/check the inserted date to current date
    primarykey
    data
    text
    <p>I am new in PHP. I have a table that stores the date. </p> <pre><code>id nic date 1 765 2012-04-20 2 654 2012-03-19 3 777 2011-01-08 </code></pre> <p>I am using jQuery calendar to insert the date. I have no idea how to validate this date to the current date, so that user cannot enter a date that is less than the current date. </p> <p>I just want to insert the date that is equal to, or greater than, the current date.</p> <p>here in my datapicker initialization code</p> <pre><code>var A_TCALCONF = { 'cssprefix' : 'tcal', 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 'longwdays' : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 'yearscroll' : true, // show year scroller 'weekstart' : 0, // first day of week: 0-Su or 1-Mo 'prevyear' : 'Previous Year', 'nextyear' : 'Next Year', 'prevmonth' : 'Previous Month', 'nextmonth' : 'Next Month', 'format' : 'Y-m-d' //'d/m/Y' // 'd-m-Y', Y-m-d', 'l, F jS Y' }; var A_TCALTOKENS = [ // A full numeric representation of a year, 4 digits {'t': 'Y', 'r': '19\\d{2}|20\\d{2}', 'p': function (d_date, n_value) { d_date.setFullYear(Number(n_value)); return d_date; }, 'g': function (d_date) { var n_year = d_date.getFullYear(); return n_year; }}, // Numeric representation of a month, with leading zeros {'t': 'm', 'r': '0?[1-9]|1[0-2]', 'p': function (d_date, n_value) { d_date.setMonth(Number(n_value) - 1); return d_date; }, 'g': function (d_date) { var n_month = d_date.getMonth() + 1; return (n_month &lt; 10 ? '0' : '') + n_month }}, // A full textual representation of a month, such as January or March {'t': 'F', 'r': A_TCALCONF.months.join('|'), 'p': function (d_date, s_value) { for (var m = 0; m &lt; 12; m++) if (A_TCALCONF.months[m] == s_value) { d_date.setMonth(m); return d_date; }}, 'g': function (d_date) { return A_TCALCONF.months[d_date.getMonth()]; }}, // Day of the month, 2 digits with leading zeros {'t': 'd', 'r': '0?[1-9]|[12][0-9]|3[01]', 'p': function (d_date, n_value) { d_date.setDate(Number(n_value)); if (d_date.getDate() != n_value) d_date.setDate(0); return d_date }, 'g': function (d_date) { var n_date = d_date.getDate(); return (n_date &lt; 10 ? '0' : '') + n_date; }}, // Day of the month without leading zeros {'t': 'j', 'r': '0?[1-9]|[12][0-9]|3[01]', 'p': function (d_date, n_value) { d_date.setDate(Number(n_value)); if (d_date.getDate() != n_value) d_date.setDate(0); return d_date }, 'g': function (d_date) { var n_date = d_date.getDate(); return n_date; }}, // A full textual representation of the day of the week {'t': 'l', 'r': A_TCALCONF.longwdays.join('|'), 'p': function (d_date, s_value) { return d_date }, 'g': function (d_date) { return A_TCALCONF.longwdays[d_date.getDay()]; }}, // English ordinal suffix for the day of the month, 2 characters {'t': 'S', 'r': 'st|nd|rd|th', 'p': function (d_date, s_value) { return d_date }, 'g': function (d_date) { n_date = d_date.getDate(); if (n_date % 10 == 1 &amp;&amp; n_date != 11) return 'st'; if (n_date % 10 == 2 &amp;&amp; n_date != 12) return 'nd'; if (n_date % 10 == 3 &amp;&amp; n_date != 13) return 'rd'; return 'th'; }} ]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload