Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="date" id="a">
- <script>
- this.toDateInput = Symbol( 'czNic::Date' );
- Date.prototype[ this.toDateInput ] = function ()
- {
- return new Date( this.getTime() - ( this.getTimezoneOffset() * 60000 ) ).toISOString().split( 'T' )[ 0 ];
- };
- const b = new Date();
- document.getElementById('a').value = b[ this.toDateInput ]();
- </script>
Add Comment
Please, Sign In to add comment