home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / owinc.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  3.0 KB  |  91 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  18.                 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  19.                 xmlns:ow="http://openwiki.com/2001/OW/Wiki"
  20.                 extension-element-prefixes="msxsl ow"
  21.                 exclude-result-prefixes=""
  22.                 version="1.0">
  23.  
  24. <msxsl:script language="JScript" implements-prefix="ow">
  25.     var longMonths = new Array("January", "February", "March", "April", "May", "June",
  26.                                "July", "August", "September", "October", "November", "December");
  27.     var shortMonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun",
  28.                                 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
  29.  
  30.     function urlencode(pData) {
  31.         return escape(pData);
  32.     }
  33.  
  34.     function formatLongDate(pData) {
  35.         var year  = pData.substring(0, 4);
  36.         var month = pData.substring(5, 7);
  37.         var day   = pData.substring(8, 10);
  38.         if (day.charAt(0) == '0') {
  39.             day = day.charAt(1);
  40.         }
  41.  
  42.         // euro-style:
  43.         // return day + "-" + longMonths[month-1] + "-" + year;
  44.  
  45.         // us-style:
  46.         return longMonths[month-1] + " " + day + ", " + year;
  47.     }
  48.  
  49.     function formatShortDate(pData) {
  50.         var year  = pData.substring(0, 4);
  51.         var month = pData.substring(5, 7);
  52.         var day   = pData.substring(8, 10);
  53.         if (day.charAt(0) == '0') {
  54.             day = day.charAt(1);
  55.         }
  56.  
  57.         // euro-style:
  58.         // return day + "-" + shortMonths[month-1] + "-" + year;
  59.  
  60.         // us-style:
  61.         // return shortMonths[month-1] + " " + day + ", " + year;
  62.         return shortMonths[month-1] + " " + day;
  63.     }
  64.  
  65.     function formatTime(pData) {
  66.         // euro-style
  67.         return pData.substring(11, 16);
  68.  
  69.         // us-style
  70.         // return 3:15 PM
  71.     }
  72.  
  73.     function formatShortDateTime2(pData) {
  74.         var year  = pData.substring(0, 4);
  75.         var month = pData.substring(5, 7);
  76.         var day   = pData.substring(8, 10);
  77.         return formatShortDate(pData) + ", " + year + " " + formatTime(pData);
  78.         //return day + "/" + month + "/" + year + " " + formatTime(pData);
  79.     }
  80.  
  81.  
  82.     function formatLongDateTime(pData) {
  83.         return formatLongDate(pData) + " " + formatTime(pData);
  84.     }
  85.  
  86.     function formatShortDateTime(pData) {
  87.         return formatShortDate(pData) + ", " + formatTime(pData);
  88.     }
  89. </msxsl:script>
  90.  
  91. </xsl:stylesheet>