Question
I'm trying to do a search based on the week number. I can see it's easy to use day number, year number etc from variables in TWiki, but I haven't been able to work out a way of getting the week number.
Any ideas?
Environment
--
NathanReeves - 16 Dec 2003
Answer
Did you see the date formulae in the
SpreadSheetPlugin? It might offer what you need.
From your question it is not clear what you want to search for. What format is the date you try to search?
Pseudo code, assuming you have dates in format
01 Jan 2004 and have a form asking for a week number:
- Use a formula to convert the week number into a serial date, representing the first date of the week
- Calculate all 7 days of the week in serial date format
- Compose a regular expression search string of all days in the week like
"(30 Nov 2003|01 Dec 2003|02 Dec 2003|03 Dec 2003|04 Dec 2003|05 Dec 2003|06 Dec 2003)"
- Assign the search string to a variable
- Do a regular expression SEARCH based on the variable
--
PeterThoeny - 16 Dec 2003