Kaynağa Gözat

gantt chart fixes

version-14
Rushabh Mehta 13 yıl önce
ebeveyn
işleme
2870a97720
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. +5
    -3
      js/legacy/utils/datetime.js

+ 5
- 3
js/legacy/utils/datetime.js Dosyayı Görüntüle

@@ -41,6 +41,7 @@ function int_to_str(i, len) {
wn.datetime = {
str_to_obj: function(d) {
if(typeof d=="object") return d;
if(!d) return new Date();
var tm = [null, null];
if(d.search(' ')!=-1) {
@@ -57,6 +58,7 @@ wn.datetime = {
},

obj_to_str: function(d) {
if(typeof d=='string') return d;
return d.getFullYear() + '-' + int_to_str(d.getMonth()+1,2) + '-' + int_to_str(d.getDate(),2);
},
@@ -76,9 +78,9 @@ wn.datetime = {
},
add_days: function(d, days) {
dt = dateutil.str_to_obj(d)
dt.setTime(dt.getTime()+(days*24*60*60*1000));
return dateutil.obj_to_str(dt);
var dt = dateutil.str_to_obj(d);
var new_dt = new Date(dt.getTime()+(days*24*60*60*1000));
return dateutil.obj_to_str(new_dt);
},
add_months: function(d, months) {


Yükleniyor…
İptal
Kaydet