Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Date help!

Community Beginner ,
Apr 07, 2008 Apr 07, 2008
Hi there,

I am trying to build a week view calendar, to view appointments. I am displaying a 7 column table for the days of the week (Sunday to Saturday across the top), but I also wish to add the date. I can get as far as the putting a date next to today's date but having trouble putting a date next to previous and subsequent days.

This is what I have at the moment (Please see code). As you can see, I have just set an empty string for dates other than today, because I can't get the logic quite right.

If anybody can give me any tips, it would be greatly appreciated.

Cheers.


208
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 07, 2008 Apr 07, 2008
LATEST
It's probably easier to find your Sunday first and then add 7 days.

StartDate = Now();
while (dayofweek(StartDate) gt 1)
StartDate = dateadd("d", -1, StartDate);

Now you can loop from 1 to 7 to display whatever you want.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources