Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#JavaScript (ES6), (削除) 141 (削除ここまで) 126 bytes

JavaScript (ES6), (削除) 141 (削除ここまで) 126 bytes

Saved 15 bytes by borrowing .toUTCString().slice(0,2) from Neil's answer

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?D.toUTCString().slice(0,2):(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online!

#JavaScript (ES6), (削除) 141 (削除ここまで) 126 bytes

Saved 15 bytes by borrowing .toUTCString().slice(0,2) from Neil's answer

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?D.toUTCString().slice(0,2):(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online!

JavaScript (ES6), (削除) 141 (削除ここまで) 126 bytes

Saved 15 bytes by borrowing .toUTCString().slice(0,2) from Neil's answer

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?D.toUTCString().slice(0,2):(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online!

saved 15 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

#JavaScript (ES6), 141(削除) 141 (削除ここまで) 126 bytes

Saved 15 bytes by borrowing .toUTCString().slice(0,2) from Neil's answer

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?'SuMoTuWeThFrSa'D.matchtoUTCString(/../g)[D.getDayslice(0,2)]:(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online! Try it online!

#JavaScript (ES6), 141 bytes

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?'SuMoTuWeThFrSa'.match(/../g)[D.getDay()]:(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online!

#JavaScript (ES6), (削除) 141 (削除ここまで) 126 bytes

Saved 15 bytes by borrowing .toUTCString().slice(0,2) from Neil's answer

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?D.toUTCString().slice(0,2):(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

#JavaScript (ES6), 141 bytes

Takes input as a Date object.

f=(d,n=0)=>n<42?(D=new Date(d-864e5*(24-n)),n<7?'SuMoTuWeThFrSa'.match(/../g)[D.getDay()]:(i=D.getDate())>9?i:' '+i)+`
 `[++n%7&&1]+f(d,n):''

Try it online!

AltStyle によって変換されたページ (->オリジナル) /