Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Tuesday, 23 December 2014

Operations On Date Control When they Selected

function CheckDate(sender, args) {

            var selectedDate = new Date();

            selectedDate = sender._selectedDate;

            var todayDate = new Date();

            var one_day = 1000 * 60 * 60 * 24;


            if (selectedDate.getDateOnly() > todayDate.getDateOnly()) {

                sender._selectedDate = todayDate;

                sender._textbox.set_Value(sender._selectedDate.format(sender._format));

                alert("Sorry, Future dates are not allowed");
                sender._textbox.set_Value("");
            }
            else {
                var NoOfDays = Math.ceil((todayDate.getTime() - selectedDate.getTime()) / (one_day));
                if (NoOfDays > 90) {
                    //alert("Sorry, Voucher can not be old than 90 days");
                    //sender._textbox.set_Value("");
                }
            }

        }

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.