MediaWiki  master
LanguageWa.php
Go to the documentation of this file.
1 <?php
29 class LanguageWa extends Language {
30 
42  public function date( $ts, $adj = false, $format = true, $tc = false ) {
43  $datePreference = $this->dateFormat( $format );
44  if ( $datePreference == 'ISO 8601' || $datePreference == 'walloon short' ) {
45  return parent::date( $ts, $adj, $format, $tc );
46  }
47 
48  $ts = wfTimestamp( TS_MW, $ts );
49  if ( $adj ) {
50  $ts = $this->userAdjust( $ts, $tc );
51  }
52 
53  # Walloon 'dmy' format
54  $m = (int)substr( $ts, 4, 2 );
55  $n = (int)substr( $ts, 6, 2 );
56  if ( $n == 1 ) {
57  $d = "1î d' " . $this->getMonthName( $m ) .
58  " " . substr( $ts, 0, 4 );
59  } elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
60  $d = $n . " d' " . $this->getMonthName( $m ) .
61  " " . substr( $ts, 0, 4 );
62  } elseif ( $m == 4 || $m == 8 || $m == 10 ) {
63  $d = $n . " d' " . $this->getMonthName( $m ) .
64  " " . substr( $ts, 0, 4 );
65  } else {
66  $d = $n . " di " . $this->getMonthName( $m ) .
67  " " . substr( $ts, 0, 4 );
68  }
69  return $d;
70  }
71 
79  public function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
80  $datePreference = $this->dateFormat( $format );
81  if ( $datePreference == 'ISO 8601' || $datePreference == 'walloon short' ) {
82  return parent::timeanddate( $ts, $adj, $format, $tc );
83  }
84 
85  # Walloon 'dmy' format
86  return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
87  $this->time( $ts, $adj, $format, $tc );
88  }
89 }
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Walloon (Walon)
Definition: LanguageWa.php:29
timeanddate( $ts, $adj=false, $format=true, $tc=false)
Definition: LanguageWa.php:79
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...
Definition: LanguageWa.php:42
Base class for language-specific code.
Definition: Language.php:61
userAdjust( $ts, $tz=false)
Used by date() and time() to adjust the time output.
Definition: Language.php:1920
getMonthName( $key)
Definition: Language.php:728
dateFormat( $usePrefs=true)
This is meant to be used by time(), date(), and timeanddate() to get the date preference they're supp...
Definition: Language.php:1965
time( $ts, $adj=false, $format=true, $timecorrection=false)
Definition: Language.php:2052