Skip to content

Instantly share code, notes, and snippets.

@srl295
Created June 17, 2019 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srl295/4ce6860667770b5cf563c383897d1b20 to your computer and use it in GitHub Desktop.
Save srl295/4ce6860667770b5cf563c383897d1b20 to your computer and use it in GitHub Desktop.
get hebrew calendar numbers
// for https://github.com/tc39/ecma402/pull/345#issuecomment-501813382
const l="en-u-ca-hebrew";
const f0 = new Intl.DateTimeFormat("en-u-ca-hebrew",{month:"numeric"});
const f1 = new Intl.DateTimeFormat("en-u-ca-hebrew",{year:"numeric",month:"short"});
const s0 = new Date('2018-01-01 00:00:00Z').getTime();
for(var i=0;i<30;i++) {
const d2 = new Date(s0+(86400*28*1000*i));
console.log( 'M=', f0.formatToParts(d2)[0].value,
d2.toLocaleDateString(), f1.format(d2));
}
M= 4 12/31/2017 Tevet 5778
M= 5 1/28/2018 Shevat 5778
M= 6 2/25/2018 Adar 5778
M= 7 3/25/2018 Nisan 5778
M= 8 4/22/2018 Iyar 5778
M= 9 5/20/2018 Sivan 5778
M= 10 6/17/2018 Tamuz 5778
M= 11 7/15/2018 Av 5778
M= 12 8/12/2018 Elul 5778
M= 12 9/9/2018 Elul 5778
M= 1 10/7/2018 Tishri 5779
M= 2 11/4/2018 Heshvan 5779
M= 3 12/2/2018 Kislev 5779
M= 4 12/30/2018 Tevet 5779
M= 5 1/27/2019 Shevat 5779
M= 6 2/24/2019 Adar I 5779
M= 7 3/24/2019 Adar II 5779
M= 8 4/21/2019 Nisan 5779
M= 9 5/19/2019 Iyar 5779
M= 10 6/16/2019 Sivan 5779
M= 11 7/14/2019 Tamuz 5779
M= 12 8/11/2019 Av 5779
M= 13 9/8/2019 Elul 5779
M= 1 10/6/2019 Tishri 5780
M= 2 11/3/2019 Heshvan 5780
M= 3 12/1/2019 Kislev 5780
M= 4 12/29/2019 Tevet 5780
M= 4 1/26/2020 Tevet 5780
M= 5 2/23/2020 Shevat 5780
M= 6 3/22/2020 Adar 5780
@srl295
Copy link
Author

srl295 commented Jun 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment