Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2000
Web server: Apache 1.3.28
Perl version: 5.6.1
Client OS: Windows XP
Web Browser: IE

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

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2004-03-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.