Link to home
Start Free TrialLog in
Avatar of lauren4110
lauren4110

asked on

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) ?

Thanks.
Avatar of pratigan
pratigan
Flag of United States of America image

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);
@Text(thisfriday)
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);
@Trim(@Replace(temp;@Text(@DbLookup("":"";"";"Name";1));""))
Hope this is something you can use.
:)
ASKER CERTIFIED SOLUTION
Avatar of scottrma
scottrma

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndrewJayPollack
AndrewJayPollack

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.
Avatar of lauren4110

ASKER

Not entirely what i was initially looking for, but works for me! Thanks!