浏览代码

Traduction getDayByNumber

reduction
Guillaume 4 年前
父节点
当前提交
b83ec82e11
共有 1 个文件被更改,包括 23 次插入10 次删除
  1. +23
    -10
      ShopBundle/Services/Utils.php

+ 23
- 10
ShopBundle/Services/Utils.php 查看文件

@@ -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] ;

正在加载...
取消
保存