4040 font-size : 11px ;
4141 width : 98% ;
4242 }
43+ [name = "hash" ] {
44+ width : 100% ;
45+ }
4346 }
4447 # commit-msg-output {
4548 height : 168px ;
4649 font-size : 11px ;
4750 width : 98% ;
4851 }
49- # hash ,
5052 # commit-msg-hash {
5153 width : 100% ;
5254 }
@@ -912,7 +914,7 @@ <h2>change commit timestamp</h2>
912914 const offsetRange = parent . querySelector ( `[name="offset"]` ) ;
913915 const offsetOutput = parent . querySelector ( `[name="offset-output"]` ) ;
914916 const offsetButton = parent . querySelector ( `[name="offset-button"]` ) ;
915-
917+
916918 const nowButton = parent . querySelector ( `[name="now"]` ) ;
917919
918920 var year = ( function ( target ) {
@@ -1053,13 +1055,14 @@ <h2>change commit timestamp</h2>
10531055 d . select ( ) ;
10541056 } ) ;
10551057 d . addEventListener ( "input" , function ( e ) {
1056- update ( ) ;
1058+ var d = getInputsTime ( ) ;
1059+ update ( d ) ;
10571060 } ) ;
10581061 return d ;
1059- } ) ( parent . querySelector ( "# hash") ) ;
1062+ } ) ( parent . querySelector ( '[name=" hash"]' ) ) ;
10601063
10611064 range ( offsetRange , ( v ) => {
1062- var d = getDateWithOffset ( ) ;
1065+ var d = getInputsTime ( ) ;
10631066
10641067 offsetOutput . textContent = d . toISOString ( ) + " - " + humanReadable ( v ) ;
10651068 } ) ;
@@ -1077,7 +1080,7 @@ <h2>change commit timestamp</h2>
10771080 return res . join ( " " ) ;
10781081 }
10791082
1080- function getCurrentTime ( ) {
1083+ function getInputsTime ( ) {
10811084 var d = new Date ( ) ;
10821085
10831086 d . setFullYear ( year . value ) ;
@@ -1101,7 +1104,7 @@ <h2>change commit timestamp</h2>
11011104 }
11021105
11031106 function getDateWithOffset ( ) {
1104- var d = getCurrentTime ( ) ;
1107+ var d = getInputsTime ( ) ;
11051108
11061109 var offset = parseInt ( offsetRange . value , 10 ) ;
11071110
@@ -1129,7 +1132,7 @@ <h2>change commit timestamp</h2>
11291132
11301133 offsetOutput . textContent = d . toISOString ( ) + " - " + humanReadable ( offset ) ;
11311134
1132- setInputsWithDate ( d )
1135+ setInputsWithDate ( d ) ;
11331136
11341137 update ( d ) ;
11351138 } ) ;
@@ -1144,7 +1147,7 @@ <h2>change commit timestamp</h2>
11441147 var pre = element . value ;
11451148
11461149 return function ( d ) {
1147- d = d ?? getCurrentTime ( ) ;
1150+ d = d ?? getInputsTime ( ) ;
11481151
11491152 element . value = pre . replace ( / x x x / g, d . toISOString ( ) ) . replace ( / y y y / g, hash . value ) ;
11501153 } ;
@@ -1203,13 +1206,13 @@ <h2>change commit timestamp</h2>
12031206 < button name ="now "> now</ button >
12041207 </ div >
12051208 < div >
1206- < input type ="text " id ="hash " value ="d06798b8722b52c9643bbd72f3f07bd7598777d4 " />
1209+ < input type ="text " name ="hash " value ="d06798b8722b52c9643bbd72f3f07bd7598777d4 " />
12071210 </ div >
12081211 < div >
12091212 < br />
12101213 < br />
12111214 < br />
1212- < input type ="range " name ="offset " min ="1 " max ="21600 " step ="1 " value ="80 " style ="width: 100% " />
1215+ < input type ="range " name ="offset " min ="0 " max ="21600 " step ="1 " value ="0 " style ="width: 100% " />
12131216 </ div >
12141217 < div >
12151218 < pre name ="offset-output "> </ pre >
0 commit comments