MediaWiki REL1_39
LanguageWa.php
Go to the documentation of this file.
1<?php
29class LanguageWa extends Language {
30
42 public function date( $ts, $adj = false, $format = true, $tc = false ) {
43 $ts = wfTimestamp( TS_MW, $ts );
44 if ( $adj ) {
45 $ts = $this->userAdjust( $ts, $tc );
46 }
47 $datePreference = $this->dateFormat( $format );
48
49 # ISO (YYYY-mm-dd) format
50 # we also output this format for YMD (eg: 2001 January 15)
51 if ( $datePreference == 'ISO 8601' ) {
52 $d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
53 return $d;
54 }
55
56 # dd/mm/YYYY format
57 if ( $datePreference == 'walloon short' ) {
58 $d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
59 return $d;
60 }
61
62 # Walloon format
63 # we output this in all other cases
64 $m = (int)substr( $ts, 4, 2 );
65 $n = (int)substr( $ts, 6, 2 );
66 if ( $n == 1 ) {
67 $d = "1î d' " . $this->getMonthName( $m ) .
68 " " . substr( $ts, 0, 4 );
69 } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
70 $d = $n . " d' " . $this->getMonthName( $m ) .
71 " " . substr( $ts, 0, 4 );
72 } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
73 $d = $n . " d' " . $this->getMonthName( $m ) .
74 " " . substr( $ts, 0, 4 );
75 } else {
76 $d = $n . " di " . $this->getMonthName( $m ) .
77 " " . substr( $ts, 0, 4 );
78 }
79 return $d;
80 }
81
89 public function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
90 $datePreference = $this->dateFormat( $format );
91 if ( $datePreference == 'ISO 8601' ) {
92 return parent::timeanddate( $ts, $adj, $format, $tc );
93 } else {
94 return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
95 $this->time( $ts, $adj, $format, $tc );
96 }
97 }
98}
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Walloon (Walon)
timeanddate( $ts, $adj=false, $format=true, $tc=false)
date( $ts, $adj=false, $format=true, $tc=false)
Dates in Walloon are "1î d' <monthname>" for 1st of the month, "<day> di <monthname>" for months star...
Base class for language-specific code.
Definition Language.php:53
userAdjust( $ts, $tz=false)
Used by date() and time() to adjust the time output.
getMonthName( $key)
Definition Language.php:860
dateFormat( $usePrefs=true)
This is meant to be used by time(), date(), and timeanddate() to get the date preference they're supp...
time( $ts, $adj=false, $format=true, $timecorrection=false)