Browse Source

Traduction getDayByNumber

reduction
Guillaume 4 years ago
parent
commit
b83ec82e11
1 changed files with 23 additions and 10 deletions
  1. +23
    -10
      ShopBundle/Services/Utils.php

+ 23
- 10
ShopBundle/Services/Utils.php View File

@@ -65,17 +65,30 @@ class Utils
$this->em = $em ;
}

public static function getDayByNumber($number)
public static function getDayByNumber($number, $lang = 'fr')
{
$daysArray = [
1 => 'Lundi',
2 => 'Mardi',
3 => 'Mercredi',
4 => 'Jeudi',
5 => 'Vendredi',
6 => 'Samedi',
7 => 'Dimanche'
] ;
if($lang == 'fr') {
$daysArray = [
1 => 'Lundi',
2 => 'Mardi',
3 => 'Mercredi',
4 => 'Jeudi',
5 => 'Vendredi',
6 => 'Samedi',
7 => 'Dimanche'
] ;
}
else {
$daysArray = [
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
4 => 'Thursday',
5 => 'Friday',
6 => 'Saturday',
7 => 'Sunday',
] ;
}

if(isset($daysArray[$number])) {
return $daysArray[$number] ;

Loading…
Cancel
Save