By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

calander question about getting the day of the seected date

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


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

"Kurt Schroeder" wrote:
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

Nov 19 '05 #2

P: n/a
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.ToLongDateStrin g());

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)
"Kurt Schroeder" wrote:
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

Nov 19 '05 #3

P: n/a
you guess right..... (i hate simple answers)
thanks you
kes

"IntelYogi" wrote:
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.ToLongDateStrin g());

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)
"Kurt Schroeder" wrote:
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

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.