Every line of 'moment add hours' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
91 addHours(hours) { 92 hours = hours || 0; 93 return this.addMilliseconds(hours * 3600000 /* Hour */); 94 }
13 function addHours(d, hours) { 14 var newDate = clone(d); 15 newDate.setHours(d.getHours() + hours); 16 return newDate; 17 }
10 export default function addHours(time, hours) { 11 const t = new Date(time.getTime()); 12 t.setHours(t.getHours() + hours); 13 return t; 14 }
433 value: function addHours(n) { 434 return this.addMinutes(n * 60); 435 }
162 add (date: Date, hours: number, dayType: Day = Day.REGULAR_DAY) { 163 this._times.push({date, hours, dayType}) 164 }
3452 value: function addHour(h) { 3453 var now = new Date(); 3454 now.setHours(now.getHours() + h); 3455 return now; 3456 }
120 convertTo24Hour( hour ) { 121 if ( 'PM' === this.amPmRef.current.value && hour < 12 ) { 122 hour += 12; 123 } else if ( 'AM' === this.amPmRef.current.value && 12 === hour ) { 124 hour = 0; 125 } 126 127 return hour; 128 }
18 addHours(val: number) { 19 this.value += val * 60 * 60 20 }
16 function date_by_subtracting_hours(date, hours) { 17 return new Date( 18 date.getFullYear(), 19 date.getMonth(), 20 date.getDate(), 21 date.getHours() - hours, 22 date.getMinutes(), 23 date.getSeconds(), 24 date.getMilliseconds() 25 ); 26 }
116 export function makeDuration(hours) { 117 const start = moment(hours.start, ["h:ma", "H:m"]); 118 let end = moment(hours.end, ["h:ma", "H:m"]); 119 120 const startInt = parseInt(hours.start, 10); 121 const endInt = parseInt(hours.end, 10); 122 123 if (startInt > endInt) { 124 end = end.add(1, "d"); 125 } 126 127 return end.diff(start, "hours"); 128 }