添加hh:mm到hh:mm得到新的hh:mm然后返回新的日期 [英] add hh:mm to hh:mm to get new hh:mm then return new date

查看:83
本文介绍了添加hh:mm到hh:mm得到新的hh:mm然后返回新的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 this.returnDateTime = ko.computed(function() {
var selectedHr,selectedMin,jd,day,hr,min;
       if (self.startTime().split(" ")[1] === "AM") {
            if (self.startTime() === '12:00 AM'||self.startTime() === '12:30 AM') {
              selectedHr = 0;
            } else {
              selectedHr = parseInt(self.startTime().split(" ")[0].split(":")[0]);
            }
          } else {
            if (self.startTime() === '12:00 PM'||self.startTime() === '12:30 PM') {
              selectedHr = 12;
            } else {
              selectedHr = parseInt(self.startTime().split(" ")[0].split(":")[0]) + 12;
            }
          }
          selectedMin= parseInt(self.startTime().split(" ")[0].split(":")[1]);
          jd=self.Duration().split(" ");//it will be variable based on distance(format is: 2 day 2hr 33min (or) 5hr 45min)
          if(jd[1]==="day(s)")
          {
              day=jd[0];hr=jd[2];min=jd[4];
          }else if(jd[1]==="hr(s)"){hr=jd[0];min=jd[2]}
     
var startDate=moment($('#startDate').val()).format("DD/MM/YYYY");// if it is 25/01/2016
/// how to add duration days hrs mins to the selected startDateand startTime and get the new date and time
}









这里选择日期DD / MM / YYYY到startDate.Time(hh:mm AM / PM)成startTime

基于持续时间ime进入持续时间为ex:3天4小时30分钟或者有时基于距离我只有小时分钟。



然后如何为startTime添加持续时间并获得新的约会时间





here am selecting date DD/MM/YYYY into startDate.Time(hh:mm AM/PM) into startTime
based on duration am getting time into Duration as ex:3days 4 hrs 30min or sometimes based on distance am getting hrs min only.

then how to add duration to startTime and get new date time

推荐答案

' #startDate') .val())。format( DD / MM / YYYY); // 如果是25/01/2016
/// 如何将持续时间hrs分钟添加到选定的startDate和startTime并获取新的日期和时间
}
('#startDate').val()).format("DD/MM/YYYY");// if it is 25/01/2016 /// how to add duration days hrs mins to the selected startDateand startTime and get the new date and time }

< br $> b $ b





这里选择日期DD / MM / YYYY到startDate.Time(hh:mm AM / PM)进入startTime

基于持续时间我是否有时间进入持续时间为例如:3天4小时30分钟或有时基于距离我只有小时分钟。



然后如何t o为startTime添加持续时间并获取新的日期时间





here am selecting date DD/MM/YYYY into startDate.Time(hh:mm AM/PM) into startTime
based on duration am getting time into Duration as ex:3days 4 hrs 30min or sometimes based on distance am getting hrs min only.

then how to add duration to startTime and get new date time


这篇关于添加hh:mm到hh:mm得到新的hh:mm然后返回新的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆