• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

target date is first Sunday from today's date

I have a formfield textbox that has a dropdown calendar attached to it.

Here are my questions:
1. How can I autopopulate the first coming sunday in the txt field: Me.txtTargetDate.Text = DateTime.Now.AddMonths(+3).ToString("d"). What do I replace the AddMonths(+3) with?
2. How can I disable all other days (except for Sunday) on the ajax calendar?
or if that's not possibel how can I validate that Sunday are only valid days to be selected?

Thanks  a lot!
1 Solution
Kyle AbrahamsSenior .Net DeveloperCommented:
DateTime.Now.AddDays(7 - DateTime.Now.DayOfWeek)

to validate is sunday:

if DayOfWeek.Sunday.CompareTo(ctype(.txtTargetDate.Text,date))= 0 then
'is sunday.


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now