File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,11 @@ setInterval(() => {
7979 const date = newdt . getDate ( ) ;
8080 /* console.log(dy[day]); */
8181 /* console.log(hours); */
82- const hrin12format = hours >= 13 ? hours % 12 : hours ;
83- const apmp = hours >= 12 ? "PM " : "AM" ;
82+ const hrin12format = hours === 0 ? 12 : ( hours > 12 ? hours - 12 : hours ) ;
83+ const apmp = hours >= 12 ? "PM" : "AM" ;
8484 const min = minutes < 10 ? "0" + minutes : minutes ;
8585 const hrs = hrin12format < 10 ? "0" + hrin12format : hrin12format ;
86- const nhr = hrin12format == "00" ? "12" : hrin12format ;
87- time . innerHTML = ` <span class="tm">${ nhr } :${ min } ${ apmp } </span>` ;
86+ time . innerHTML = ` <span class="tm">${ hrs } :${ min } ${ apmp } </span>` ;
8887 dt . innerHTML = `<span class="dt1"> ${ dy [ day ] } , ${ date } ${ mth [ month ] } </span>` ;
8988} , 1000 ) ;
9089
You can’t perform that action at this time.
0 commit comments