Find Today is Sunday or Not by Jquery

Wednesday, August 3, 2011

Hello Friends,

Please find below demo and code to find date is sunday or not, please check it out.


Year : (only interger)

Month : (only interger)

Date : (only interger)

<title>jQuery test page</title>
<script src="" type="text/javascript"></script>

<script type="text/javascript">

function getsunday(date) {
        var day = date.getDay();
        return [(day != 0), ''];

function FindTodayisSunday() {
            if(getsunday(new Date(document.getElementById('txtyear').value,document.getElementById('txtmonth').value-1,document.getElementById('txtdate').value))!='true,'){
            document.getElementById('error').innerHTML="Today is sunday.";
            document.getElementById("error").setAttribute("style", "color:Green;"); 
            document.getElementById('error').innerHTML="Today is not sunday";
            document.getElementById("error").setAttribute("style", "color:Red;"); 
Year : <input type="text" id="txtyear"/><i>(only interger)</i><br />
Month : <input type="text" id="txtmonth"/><i>(only interger)</i><br />
Date : <input type="text" id="txtdate" onblur="FindTodayisSunday()" /><i>(only interger)</i><br />
<span id="error"></span>

Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Senior Asp.Net Developer
e-Procurement Technologies Ltd (India)

No comments :