MediaWiki master
LanguageWa.php
Go to the documentation of this file.
1<?php
22
31class LanguageWa extends Language {
32
40 public function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
41 $datePreference = $this->dateFormat( $format );
42 if ( $datePreference == 'ISO 8601' || $datePreference == 'walloon short' ) {
43 return parent::date( $ts, $adj, $format, $timecorrection );
44 }
45
46 $ts = wfTimestamp( TS_MW, $ts );
47 if ( $adj ) {
48 $ts = $this->userAdjust( $ts, $timecorrection );
49 }
50
51 # Walloon 'dmy' format
52 $m = (int)substr( $ts, 4, 2 );
53 $n = (int)substr( $ts, 6, 2 );
54 if ( $n == 1 ) {
55 $d = "1î d' " . $this->getMonthName( $m ) .
56 " " . substr( $ts, 0, 4 );
57 } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
58 $d = $n . " d' " . $this->getMonthName( $m ) .
59 " " . substr( $ts, 0, 4 );
60 } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
61 $d = $n . " d' " . $this->getMonthName( $m ) .
62 " " . substr( $ts, 0, 4 );
63 } else {
64 $d = $n . " di " . $this->getMonthName( $m ) .
65 " " . substr( $ts, 0, 4 );
66 }
67 return $d;
68 }
69
70 public function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
71 $datePreference = $this->dateFormat( $format );
72 if ( $datePreference == 'ISO 8601' || $datePreference == 'walloon short' ) {
73 return parent::timeanddate( $ts, $adj, $format, $tc );
74 }
75
76 # Walloon 'dmy' format
77 return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
78 $this->time( $ts, $adj, $format, $tc );
79 }
80}
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:78
userAdjust( $ts, $tz=false)
Used by date() and time() to adjust the time output.
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)