Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _calcularTiempoPendiente: function (EstimIngrDate,EstimIngrTime, TurnNo) { // debe recibir TurnNo también
- TurnNo = Number(TurnNo);
- let tiempoPendiente;
- if (TurnNo > 0) {
- let today = new Date();
- let horaIngEstim = new Date(EstimIngrTime.ms);
- // EntrAnnouncedDate.setTime(EntrAnnouncedTime.ms)
- let TZOffsetMs = new Date(0).getTimezoneOffset() * 60 * 1000;
- let fechaIngEstim = new Date(EstimIngrTime.ms + TZOffsetMs)
- fechaIngEstim.setFullYear(EstimIngrDate.getFullYear())
- fechaIngEstim.setDate(EstimIngrDate.getDate())
- fechaIngEstim.setMonth(EstimIngrDate.getMonth())
- let diffMs = (today - fechaIngEstim);
- // let diffDays = Math.floor(diffMs / 86400000); // days
- let diffHrs = Math.floor((diffMs /*% 86400000*/ ) / 3600000); // hours
- let diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes
- return ((diffHrs >= 10 ? diffHrs + "" : "0" + diffHrs) + ":" + (diffMins !== 0 ? diffMins : "00") + " hs");
- } else if (TurnNo === 0) {
- return "Descargando";
- } else {
- return "Descargó";
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement