Skip to content

Commit

Permalink
Update field to datetime widget and Amsha Chart functions change
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjayPrabhakaran committed Apr 3, 2024
1 parent a09a0cc commit 8459ff7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
12 changes: 6 additions & 6 deletions SJPv6/www/SJP.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
<td>
<input id=bdate name=bdate type=date onchange="updateDMY(event)" > (Format YYYY-MM-DD)
<input id=btime name=btime type=time step=1 onchange="updateTime(event)"><br/>
Day:<input id=day name=day type=number max=31 style="width:7em"> ;
Month:<input id=month name=month type=number max=12 style="width:7em">
Year:<input id=year name=year type=number style="width:10em"> <br/>
Day:<input id=day name=day type=number max=31 style="width:7em" onchange="updateDateTimeWidget()"> ;
Month:<input id=month name=month type=number max=12 style="width:7em"onchange="updateDateTimeWidget()">
Year:<input id=year name=year type=number style="width:10em" onchange="updateDateTimeWidget()"> <br/>

Time:<input id=hours name=hours type=number max=24 style="width:5em">
:<input id=mins name=mins type=number max=59 style="width:5em">
:<input id=secs name=secs type=number max=59 style="width:5em">
Time:<input id=hours name=hours type=number max=24 style="width:5em" onchange="updateDateTimeWidget()">
:<input id=mins name=mins type=number max=59 style="width:5em" onchange="updateDateTimeWidget()">
:<input id=secs name=secs type=number max=59 style="width:5em" onchange="updateDateTimeWidget()">

</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion SJPv6/www/SJPamsha.htm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
'<div id=charts>'
+document.getElementById("charts").innerHTML
+editlink
+getPlainChart(chart,params['Division'])
+getChart(chart,params['Division'],params['Division'])
+'</div>'
;
document.close();
Expand Down
14 changes: 14 additions & 0 deletions SJPv6/www/sjp.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,20 @@ lat,long = 39n17, 76w37;
document.getElementById("month").value =date.getMonth()+1;
document.getElementById("year").value =date.getFullYear();
}
function updateDateTimeWidget(){

var date= new Date(document.getElementById("bdate").value);
date.setDate(document.getElementById("day").value);
date.setMonth(document.getElementById("month").value -1);
date.setFullYear(document.getElementById("year").value);
document.getElementById("bdate").value=date.toISOString().slice(0,10)
//var time= (document.getElementById("btime").value).split(":");
//date.setHours(time[0]*1,time[1]*1,time[2]*1)
document.getElementById("btime").value=(document.getElementById("hours").value+"").padStart(2,"0")+":"
+(document.getElementById("mins").value+"").padStart(2,"0")+":"
+(document.getElementById("secs").value+"").padStart(2,"0");

}
function updateTime(){
var time= (document.getElementById("btime").value).split(":");
//alert("changed"+time);
Expand All @@ -284,6 +297,7 @@ function updateTime(){
document.getElementById("secs").value =time[2];
}


function initCurrentHMSDMY(){
var d=new Date();
document.getElementById("hours").value =d.getHours();
Expand Down

0 comments on commit 8459ff7

Please sign in to comment.