[pmwiki-users] Re: WikiCalendar date markup

Nate Cull nate at natecull.org
Mon May 9 03:47:49 CDT 2005


On Mon, 2005-05-09 at 10:27 +0200, chr at home.se wrote:
> On 9 May 2005, John Rankin wrote:
> 
> > On Monday, 9 May 2005 3:25 AM, chr at home.se wrote:
> > >It's probably relatively easy to create a custom markup that
> > >transforms
> > >
> > >	(:calendar 20050501:)
> > >
> > >into e.g.
> > >
> > >	[[Calendar/20050501 | Monday 16 May 2005]]
> > >
> > >or however you want the link to appear. I don't think it's a good idea to
> > >use the approach where all occurences of a string such as '2005-05-01' is
> > >transformed into a long date format.
> > >
> > >Anyway, the person to ask about this stuff is John, I wonder why he's been 
> > >quiet though...
> > 
> > Er, because it's the weekend and I was not near a web connected computer.
> > (Weekend: that time when one has an opportunity to walk on the beach,
> > tidy the garden, watch a movie, listen to misic, play with the cat...)
> 
> Hey! I think I just did one of those things! :-)
> 
> > I will review the discussion and respond with something helpful ASAP.
> > 
> > My initial quick thought is that we add a capability to recognise
> > 
> > [[some group/yyyymmdd]] 
> > 
> > as a date reference and automatically translate it into 
> > 
> > [[some group/yyyymmdd | Dayname dd Monthname yyyy]]
> > 
> > The format would of course be configurable. No worries.
> 
> Please note that this might be very annoying for people who happen to have 
> a page like
> 	NotCalenderGroup/20010102
> where they *don't* want the link to be automatically translated. Would it 
> be possible for the markup to check that 'some group' actually is a valid 
> "calender"-group? Perhaps the admin could specify a list of these?
> 
> /Christian
> 

For now I've just used this custom markup:

Markup('magicdate','inline','/\[\[Calendar([\.\/])(\d\d\d\d\d\d\d
\d)\]\]/e', "((IsDate('$2')) ? '[[Calendar$1$2|' . longdate('$2') .
']]' : '$0')");

which is based on wdate but changes only the title of links. It
hardcodes the group Calendar so it's not good enough to put into the
script itself, but worth adding to the page maybe?





More information about the pmwiki-users mailing list