2016-01-13 94 views
0

年停在2006年的daterangepicker我不知道为什么?当年js年在2006年停止

我的代码是:

<script type="text/javascript"> 
    moment.locale('fr'); 
    $(document).ready(function() { 

     $('#sdate').daterangepicker({ 
     singleDatePicker: true, 
     timePicker: true, 
     timePicker24Hour: true, 
     locale: { 
      format: "LLLL", 
      applyLabel: 'Appliquer', 
      cancelLabel: 'Annuler' 
     }, 
     firstDay: 1 
     }); 
    }); 
</script> 

The error in the bottom

在我的电脑的时间是正确的

enter image description here

+0

奇怪。什么是你的电脑上的时钟? – kometen

+0

在我的电脑中的时间是正确的...问题出现在FIREFOX中,因为在谷歌浏览器Chrome完美工作。 –

回答

0

我们必须规范我们的源代码将在所有的浏览器能运行。

1 - 使用format+string

2 - 不使用点 “。” 或 “-” 的日期,我们必须只使用 “/

3 - 可以看到this document

所以在“格式”部分的代码将是这样的:

<script type="text/javascript"> 
    moment.locale('fr'); 
    $(document).ready(function() { 

     $('#sdate').daterangepicker({ 
     singleDatePicker: true, 
     timePicker: true, 
     timePicker24Hour: true, 
     locale: { 
      format: ("Jeudi 14/Janvier/2016 10:30", "dddd DD/MMMM/YYYY HH:mm"), 
      applyLabel: 'Appliquer', 
      cancelLabel: 'Annuler' 
     }, 
     firstDay: 1 
     }); 
    }); 
</script>