MediaWiki master
LanguageWa.php
Go to the documentation of this file.
1<?php
29class LanguageWa extends Language {
30
38 public function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
39 $datePreference = $this->dateFormat( $format );
40 if ( $datePreference == 'ISO 8601' || $datePreference == 'walloon short' ) {
41 return parent::date( $ts, $adj, $format, $timecorrection );
42 }
43
44 $ts = wfTimestamp( TS_MW, $ts );
45 if ( $adj ) {
46 $ts = $this->userAdjust( $ts, $timecorrection );
47 }
48
49 # Walloon 'dmy' format
50 $m = (int)substr( $ts, 4, 2 );
51 $n = (int)substr( $ts, 6, 2 );
52 if ( $n == 1 ) {
53 $d = "1î d' " . $this->getMonthName( $m ) .
54 " " . substr( $ts, 0, 4 );
55 } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
56 $d = $n . " d' " . $this->getMonthName( $m ) .
57 " " . substr( $ts, 0, 4 );
58 } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
59 $d = $n . " d' " . $this->getMonthName( $m ) .
60 " " . substr( $ts, 0, 4 );
61 } else {
62 $d = $n . " di " . $this->getMonthName( $m ) .
63 " " . substr( $ts, 0, 4 );
64 }
65 return $d;
66 }
67
68 public function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
69 $datePreference = $this->dateFormat( $format );
70 if ( $datePreference == 'ISO 8601' || $datePreference == 'walloon short' ) {
71 return parent::timeanddate( $ts, $adj, $format, $tc );
72 }
73
74 # Walloon 'dmy' format
75 return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
76 $this->time( $ts, $adj, $format, $tc );
77 }
78}
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Walloon (Walon)
date( $ts, $adj=false, $format=true, $timecorrection=false)
Dates in Walloon are "1î d' <monthname>" for 1st of the month, "<day> di <monthname>" for months star...
timeanddate( $ts, $adj=false, $format=true, $tc=false)
Base class for language-specific code.
Definition Language.php:63
userAdjust( $ts, $tz=false)
Used by date() and time() to adjust the time output.
getMonthName( $key)
Definition Language.php:734
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)