-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreenreader-dates.min.js
More file actions
1 lines (1 loc) · 943 Bytes
/
Copy pathscreenreader-dates.min.js
File metadata and controls
1 lines (1 loc) · 943 Bytes
1
function applyLabel(a){function j(a){g=["January","February","March","April","May","June","July","August","September","October","November","December"][a]}function k(a){h=["Zero","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eight","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth","Twentieth","Twenty-first","Twenty-second","Twenty-third","Twenty-fourth","Twenty-fifth","Twenty-sixth","Twenty-seventh","Twenty-eight","Twenty-ninth","Thirtieth","Thirty-first"][a]}function l(a){i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a]}var g,h,i,b=new Date(a.getAttribute("datetime")),c=b.getFullYear(),d=b.getMonth(),e=b.getDate(),f=b.getDay();console.log(b),j(d),k(e),l(f),a.setAttribute("aria-label",i+", "+g+" "+h+", "+c+".")}var elements=document.querySelectorAll("time[datetime]");elements.forEach(function(a){applyLabel(a)});