JSFiddle - React, Tailwind, and code Playground
by arjuncc
JavaScript
function HourCalculator(hours){
this.hours=hours;
}
HourCalculator.prototype.format = function(){
var frHour = "00";
var frMin = "00";
var formatedHour = "00.00";
if(this.hours.indexOf('.') === -1){
frHour = this.hours;
} else {
frHour = this.hours.split(".")[0];
frMin = this.hours.split(".")[1];
}
formatedHour = frHour+"."+frMin;
alert("formatedHour : " + formatedHour);
}
function parseMinutes(x){hours=Math.floor(x/60); minutes=x% 60;}
function parseHours(H,M){x=M+H*60;}