You need to sign in to do that
Don't have an account?

How to get sundays from input month and year
Hi,
I want to find the the all sunday in a month based on input month name and year.
Can anyone help me out for this.
Regards,
Sarevsh
I want to find the the all sunday in a month based on input month name and year.
Can anyone help me out for this.
Regards,
Sarevsh
VF Page:
<apex:page controller="add" docType="html-5.0" id="thePage">
<script>
function printalert()
{
alert('hello');
var today=document.getElementById('thePage:theForm:dt1').value;
alert(today);
var dat = new Date(today);
var y = dat.getFullYear();
var m = dat.getMonth() + 1;
var days = new Date( y,m,0 ).getDate();
var sundays = [ (8 - (new Date( m + '/01/' + y ).getDay())) % 7 ];
for ( var i = sundays[0] + 7; i < days; i += 7 ) {
sundays.push( i );
}
alert(sundays);
}
</script>
<apex:form id="theForm">
Date: <apex:input type="date" value="{!dat}" id="dt1"/>
<apex:commandButton value="click me" onclick="printalert();return false"/>
</apex:form>
</apex:page>
controller:
public class add {
public String dat { get; set; }
public String tex1 { get; set; }
}
I want to find the all sunday for given month and year.
Thanks,