ढाँचा:Date-mf
यस ढाँचामा अप्ठ्यारा सुविधाहरू रहेका छन्। कृपया यस ढाँचालाई सम्पादन गर्नु पूर्व यस ढाँचाको व्यवस्थापन तथा पार्सर प्रणालीहरूसँग परिचित हुनुपर्छ र पनि यदि तपाईँले गरेको सम्पादनबाट कुनै जटिल तथा अप्रत्याशित समस्या आएमा तत्कालै आफ्नो सम्पादन फर्काई दिनुहोला, किनकि यो ढाँचा अत्यधिक सङ्ख्याका लेख/पृष्ठहरूमा प्रयोग भइरहेको छ। स्मरण रहोस्: तपाईँ प्रयोग आदि गर्न सक्नुहुन्छ तर यहाँ कुनै पनि प्रयोग गर्नुपूर्व सबै प्रयोग सामान्य ढाँचा प्रयोगस्थलमा अथवा आफ्नो प्रयोगकर्ता प्रयोगस्थलमा गर्नुहोस्। |
Function: Helper function for {{start-date}} and {{end-date}}. This template is of interest to template writers only. This template emits a dtstart or dtend date sequence as decribed by the hcalendar spec at the microformats community site.
Overview/Vision The main reason for existence of this template is to expose dates associated with events or people to the internet. The standards are called Microformats, and the next major release of browsers such as internet explorer and Firefox are said to allow use of this information. For example, with address or coordinate data, map icons will activate on the toolbar so that the user may see a satellite image of a place discussed in an article. Historical data might be used by a sort of google earth history- where the user can navigate not just in space, but in time. Human readable encoding of dates will make such data ubiquitous in Wikipedia, establishing it the central repository and preeminent source of semantic information on the web.
Obscure code
[सम्पादन गर्नुहोस्]- Function #titleparts is used as a string array, so that I can pass multiple parameters from a single logic point in the front end template. Normally, this would required redundantly copying the same logic if the information were passed in multiple template parameters.
- dates in up-date is in an odd range. This is done because years below 2500 can be interpreted as time by the #time function, and because dates <100 are misinterpreted. This allows a range of 6999BC to 6999AD. We could get an extra 1000 by adding 2500 instead of 3000, but it is easier on debugging if 3000 is used. This template keeps them in a high range for safety and subtract 3000 just before outputting. BC is indicated in ISO8601 with a negative sign preceding the year (see International Organization for Standardization, Technical Committee ISO/TC 154 "Annex B.1.1" (pdf), ISO8601-2004, पृ: page २७/ pdf page ३३।). Note that as of 2009-Feb, Operator misreports this as a positive number.
- precision is implemented using #time's formatting.
- the +1 day, + 1 year stuff is for time ranges. According to spec, the time end point must be just outside the range. So that if the event goes from monday to wednesday, the dtend date would be thursday. You add the unit that corresponds to the given precision.
Validating/ debugging
[सम्पादन गर्नुहोस्]See Firefox's free Operator toolbar. Check options for debug mode. There is a nice dialog to see the emitted html and the microformats that are recognized.
Splarka gets another cookie
[सम्पादन गर्नुहोस्]- Human readable dates are due not to any clever coding in this template. The real work is done by the amazing PHP function strtotime(). Splarka I think is the dude who exposed it in the #time ParserFunction.