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

Forcing certain days in a date field

I am kind of new to lotus notes development and am still learning. Right now, I have created a form and on the form, I have a date field with calendar control - so when you click on the calendar icon, a calendar pops up allowing you to click on the date from there.
However, I only want the user to be able to click on Fridays.
Is there a way to force this or validate it (eg. only Fridays are enabled on the calendar and everything else is grayed-out) ?

1 Solution
I use a similar date field without a calendar pop up.  The date field is a drop down list that defaults to the upcoming Friday, but allows selection of defferent fridays.  The code is:
in the default field: thisfriday:=@Adjust(@Date(@Now); 0; 0; (6 - @Weekday(@Date(@Now))); 0; 0; 0);
in the drop down list formula window:
thisfriday:=@Adjust(@Date(@Now); 0; 0; (6 - @Weekday(@Date(@Now))); 0; 0; 0);
s5:= @Text(@Adjust(thisfriday;0 ; 0 ;7*5;0;0;0));
s4:= @Text(@Adjust(thisfriday;0 ; 0 ;7*4;0;0;0));
s3:= @Text(@Adjust(thisfriday;0 ; 0 ;7*3;0;0;0));
s2:= @Text(@Adjust(thisfriday;0 ; 0 ;7*2;0;0;0));
s1:= @Text(@Adjust(thisfriday;0 ; 0 ;7;0;0;0));
s01:= @Text(@Adjust(thisfriday;0 ; 0 ; -7;0;0;0));
s02:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*2);0;0;0));
s03:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*3);0;0;0));
s04:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*4);0;0;0));
s05:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*5);0;0;0));
temp:= @Trim(s05:s04:s03:s02:s01:@Text(thisfriday):s1:s2:s3:s4:s5);
Hope this is something you can use.
You may not be able to grey-out particular dates on the calendar, but you can validate the date that the user entered and either allow or deny the save:

@If(@Weekday(MyDateField) != 6; @Failure("You may only choose a Friday for this date field!"); @Success)

Put the above formula into the InputValidation event for the field in question.


I wonder if you could create a fake calendar resource, like a room or something-- busy it for the days you don't want it available, and use @functions that list the availability?   That might be an interesting way to go-- if complicated.
lauren4110Author Commented:
Not entirely what i was initially looking for, but works for me! Thanks!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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