Skip to content

Instantly share code, notes, and snippets.

@seripap
Forked from bgadrian/months.js
Created October 8, 2015 21:32
Show Gist options
  • Star 67 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save seripap/9eb809268eb8026abd9f to your computer and use it in GitHub Desktop.
Save seripap/9eb809268eb8026abd9f to your computer and use it in GitHub Desktop.
JavaScript JS month names arrays
var month= ["January","February","March","April","May","June","July",
"August","September","October","November","December"];
var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"];
//used with date.getMonth()
@izmaylovdev-ume
Copy link

Thanks)

@zolon4
Copy link

zolon4 commented Sep 24, 2020

lets goooooo

@joshgrift
Copy link

Absolute Legend

@carterclark
Copy link

You are a lifesaver!!!

@pg07codes
Copy link

let days = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ];
just thought some might need this too

@shayan6
Copy link

shayan6 commented May 17, 2021

let monthFull = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
let month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
let dayFull = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ];
let day = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];

@JoeMartin2001
Copy link

Thanks guys! I have looked for a ready array of months and I have got it! Good luck! :)

@sutej-pal
Copy link

const initialDate = moment().startOf('year');
const months = Array.from({length: 12}, (e, i) => {
return moment(initialDate).add(i ,'months').format("MMM-YY");
})

@dovh-me
Copy link

dovh-me commented Feb 8, 2022

thamksss!!

@cednore
Copy link

cednore commented Feb 17, 2022

I needed this. thanks.

@arroyocoder
Copy link

arroyocoder commented Feb 22, 2022

Nice tip I've saw in the wild. Instead of "console.log" use "console.table" to visualize a pretty nice table with all properties and indexes in your developer tools. Valid for arrays and objects.
Don't know how to export the table into an excel kind of file...any tips?

@1mpuser
Copy link

1mpuser commented May 23, 2022

Ty 4 my 5 minutes of life boys!

@Darker
Copy link

Darker commented Sep 1, 2022

So glad I didn't have to type this, thanks.

@islomalarov
Copy link

Good job!

@ayodejii
Copy link

you are a legend, man.

@quantuminformation
Copy link

lol why am I still subbing to this

@eoussama
Copy link

lol why am I still subbing to this

Likewise

@quantuminformation
Copy link

Likewise

incase they add a new one

@Naveenravi07
Copy link

ty man i was so lazy

@emmanuelkant
Copy link

That god pays you!

@jowc
Copy link

jowc commented May 22, 2023

Thanks, man. I was lazy to type this out.

@ayezabashir
Copy link

Thanks, dude!

@ayezabashir
Copy link

can't it be a const instead?

Yes it can be!

@DanielaBerlin
Copy link

Thanks :)

@pelumisamuel
Copy link

Thanks, I was too lazy for this. :)

@quantuminformation
Copy link

its been fun, but alas i must unsuscribe

@krisyam
Copy link

krisyam commented Nov 8, 2023

Really useful man! Work smarter not harder!

@ib-ganz
Copy link

ib-ganz commented Dec 21, 2023

ty for my 5 minutes

@chidimo
Copy link

chidimo commented Mar 21, 2024

Thank you

@prostomuzaf
Copy link

thank bro

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