Jump to content

Every second an third monday in odd numbered month


This topic is 6928 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm strugging to grasp how to make two loops in recursive custom functions ...can anyone??? The result must be a return/pilcrow delimited list of dates within a span from day1 until day2....

--sd

Link to comment
Share on other sites

In general, you could either use a secondary function or piggy back a parameter as shown

 

But in the example given, one could simply:

- move 2 months forward;

- if 2nd Monday is in range - 2nd Monday & � &

- if 3rd Monday is in range - 3rd Monday & �

Link to comment
Share on other sites

Alright then - to the problem to make the prefix work, how would you make a calc that goes true 2nd monday en each month ...Choose(DayOfWeek(Date( ....seems a little clunkcy and not particular flexible???

--sd

Link to comment
Share on other sites

I use the custom function MatchPrefixAll( to sift out the dates made in another custom function where if a date matches a certain criteria it gets prefixed. This means that it all falls on me being able to write these conditions into a function that is flexible enough to do more that if DayOfWeek is equal to 1 then prefix the date - such as the header of this thread.

--sd

Link to comment
Share on other sites

I am lost.

I think you have made it clear what the desired output should be.

What is the input? Specifically, what is the user input and what can be hard-coded?

In iCal, if you choose 'every n-th month', you can then specify 'every m-th k DayOfWeek'. It will not let you have more than one instance of any one variable.

Do you want the user to be able to specify more than one m? Or is the 'second and third' a fixed thing?

Link to comment
Share on other sites

The user inputs a startdate and an untildate, and wishes to have all the 2nd mondays in odd numbered month if posible.

The userinterface is very close to the one in palmOS except it's not the first date that pulls but a day in the first week.

--sd

Link to comment
Share on other sites

Right, this one does what I wish for, or rather I could restrain the demands to this:

Let ( [

start = Extend ( StartDate ) ;

end = Extend ( EndDate ) ;

interval = Extend ( MonthInterval ) ;

k = Extend ( Every ) ;

wDay = Extend ( WeekDay ) ;

i = Get ( CalculationRepetitionNumber ) - 1 ;

day1 = Date ( Month ( start ) + interval * i ; 1 ; Year ( start ) ) ;

diff = wDay - DayOfWeek ( day1 ) ;

add = Mod ( diff ; 7 ) + 7 * ( k - 1 ) ;

reccurence = day1 + add

] ;

Case ( start <= reccurence and reccurence <= end ; reccurence )

)

But since I use custom functions for other ways of recurrences, would it be great to have it as CF giving a pilcrow-delimited list of usefull dates - otherwise would I need to convert the other plicrow delimited lists created into a repeating calc'field ...which of course is a posibility, and a good question why I refreain from it??

So if you right of the bat can turn it a CF ...might it contribute pretty well to my doubts smile.gif

--sd

Link to comment
Share on other sites

Indeed! ...it's really straight forward, it requires a new way of thinking for me - that I ought to have picked up some time ago ...but really havn't!!!

Thanks a lot!

--sd

Link to comment
Share on other sites

Let's not get carried away, shall we?

First, it's really quite trivial to convert a recursive repeating field calc to a custom function.

Second, it's not THAT complex a calc. (Incidentally, I could point you to some of my posts that *I* thought were the cat's pajamas - but no one else seemed to care.)

Finally, I do NOT hover six inches off the floor. The best I have managed so far is 5 1/2.

Link to comment
Share on other sites

This topic is 6928 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.