MediaWiki  REL1_24
LanguageWa.php
Go to the documentation of this file.
00001 <?php
00032 class LanguageWa extends Language {
00033 
00045     function date( $ts, $adj = false, $format = true, $tc = false ) {
00046         $ts = wfTimestamp( TS_MW, $ts );
00047         if ( $adj ) {
00048             $ts = $this->userAdjust( $ts, $tc );
00049         }
00050         $datePreference = $this->dateFormat( $format );
00051 
00052         # ISO (YYYY-mm-dd) format
00053         #
00054         # we also output this format for YMD (eg: 2001 January 15)
00055         if ( $datePreference == 'ISO 8601' ) {
00056             $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
00057             return $d;
00058         }
00059 
00060         # dd/mm/YYYY format
00061         if ( $datePreference == 'walloon short' ) {
00062             $d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
00063             return $d;
00064         }
00065 
00066         # Walloon format
00067         #
00068         # we output this in all other cases
00069         $m = substr( $ts, 4, 2 );
00070         $n = substr( $ts, 6, 2 );
00071         if ( $n == 1 ) {
00072             $d = "1î d' " . $this->getMonthName( $m ) .
00073                 " " . substr( $ts, 0, 4 );
00074         } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
00075             $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
00076                 " " . substr( $ts, 0, 4 );
00077         } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
00078             $d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
00079                 " " . substr( $ts, 0, 4 );
00080         } else {
00081             $d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
00082                 " " . substr( $ts, 0, 4 );
00083         }
00084         return $d;
00085     }
00086 
00094     function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
00095         if ( $adj ) {
00096             $ts = $this->userAdjust( $ts, $tc );
00097         }
00098         $datePreference = $this->dateFormat( $format );
00099         if ( $datePreference == 'ISO 8601' ) {
00100             return parent::timeanddate( $ts, $adj, $format, $tc );
00101         } else {
00102             return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
00103                 $this->time( $ts, $adj, $format, $tc );
00104         }
00105     }
00106 }