calander question about getting the day of the seected date

G

Guest

Hi,
quick question: this, calSelect1.SelectedDate.DayOfWeek, will return the
numeric day ofthe week for a given calander called calSelect1. is there a
function or method that can give me the text value for day of the week? so
that 0 returns sunday, 1 monday, ...?
thanks
kes
 
G

Guest

okok,
Format(calSelect1.SelectedDate, "dddd") does it, but is there a
calSelect1.SelectedDate.format("dddd") like property?
 
G

Guest

Hi Kurt,
I guess calSelect1.SelectedDate.DayOfWeek.ToString() should return you
"Sunday" and "Monday"
Probably it should work for you if not u can incorporate this function
in your code

private string getDayName(string strDataType)
{
string retVal=strDataType;
int nPos = retVal.IndexOf(",");
if (nPos != -1)
retVal = retVal.Substring(0,nPos);
return retVal;

}


Call it in your .cs as follows



string DayName = getDayName(myCalendar.SelectedDate.ToLongDateString());

But i m sure that
string Dayname2 = myCalendar.SelectedDate.DayOfWeek.ToString();
thing should work for you rather than calling the function i mentioned use
inbuilt framework features

Hope this helps you

Thanks

IntelYogi(Yogesh)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top