Hi Markus,

On 2009-03-05 03:09, Markus Krötzsch wrote:
>> Could something like this be included in SMW?
> 
> Yes. I suggest a slightly different control interface, though. The output is 
> only a problem for #ask queries, right? My suggestion is to use the existing 
> "printout modifier" mechanism that works for #ask printouts, so that one can 
> choose for each single printout which format to use. Example:
> 
> {{#ask: ...
> | ?start date
> | ?end date#ISO
> }}

That's probably better for most. I have to go through all #ask queries then, 
and append '#ISO' everywhere, but that's ok :)

> This will show a three column table with start date in localized format and 
> end date in ISO 8601 format. The ISO date is always completed (assuming 
> January and 01 as defaults for month and day as in sorting). The time 
> component may be omitted. If given, the time is separated by "T" as defined 
> in 
> the spec. Years are padded up to four digits, so you get things like 
> "0010-05-06". Negative years, as suggested by ISO, represent BC dates, with 0 
> corresponding to 1 BC, -1 corresponding to 2 BC, and so on.

Good catch, without the 'T' as separator between date and time it's not really 
ISO8601. Or at least something like "YYYY-MM-DD hh:mm:ss" (like in my patch) - 
according to [1] - "is considered two separate, but acceptable, representations 
- one for date and the other for time. It is then left to the reader to 
interpret the two separate representations as meaning a single time point based 
on the context".

> All implemented in SVN.

That was fast, thanks! :)

There is one thing I'm not 100% sure about though: Your implementation always 
prints out a complete date, like '2009-03-05' by printing out a default of '01' 
for the MM and DD parts when they are undefined.

The Wikipedia article describing ISO8601, section "General principles" [2] 
says: "For reduced accuracy, any number of values may be dropped from any of 
the date and time representations, but in the order from the least to the most 
significant."

So it would be possible to just omit the '-DD' or '-MM-DD' part when they are 
undefined. I would prefer this over SMW implying that the date is "on January 
the 1st" even though the precise point in time may actually be unknown. What do 
you think?

Patrick.

[1]: http://en.wikipedia.org/wiki/ISO8601#Combined_date_and_time_representations
[2]: http://en.wikipedia.org/wiki/ISO8601#General_principles

-- 
Key ID: 0x86E346D4            http://patrick-nagel.net/key.asc
Fingerprint: 7745 E1BE FA8B FBAD 76AB 2BFC C981 E686 86E3 46D4

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to