Skip to content

mattmachell/pasta-date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pasta-date

Making it easier to paste what people actually copy into a date input.

By default inputs of type date only accept YYYY-MM-DD formatted strings, this script is a set of handlers to intercept and reformat for a known locale.

document.addEventListener('paste',copy.pasteHandler ); document.addEventListener('copy',copy.copyHandler ); <input type="date" value="" data-date-paste="en-GB" >

Currently translates DD/MM/YY to YYYY-MM-DD on paste.

TODOs

  • Allow registration of outbound handlers.

About

Making it easier to paste into date inputs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published