添加hh:mm到hh:mm得到新的hh:mm然后返回新的日期

编程入门 行业动态 更新时间:2024-10-12 01:24:47
本文介绍了添加hh:mm到hh:mm得到新的hh:mm然后返回新的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

this.returnDateTime = koputed(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 }

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然后返回新的日期

本文发布于:2023-11-30 09:41:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649535.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:到新   日期   hh   mm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!