Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Shivabeach/3966545 to your computer and use it in GitHub Desktop.
Save Shivabeach/3966545 to your computer and use it in GitHub Desktop.
A Months array
$months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
];
@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" ];

@omkale-dev
Copy link

thanks

@Sharabaddin
Copy link

Sharabaddin commented Jul 12, 2021

kotlin:
Full name:

val convertMonth = when(month) {
    1 -> "January"
    2 ->"February"
    3 ->"March"
    4 ->"April"
    5 ->"May"
    6 ->"June"
    7 ->"July"
    8 ->"August"
    9 ->"September"
    10 ->"October"
    11 ->"November"
    12 ->"December"
    else -> ""
}

Short name:

val convertMonth = when(month) {
    1 -> "Jan"
    2 ->"Feb"
    3 ->"Mar"
    4 ->"Apr"
    5 ->"May"
    6 ->"Jun"
    7 ->"Jul"
    8 ->"Aug"
    9 ->"Sep"
    10 ->"Oct"
    11 ->"Nov"
    12 ->"Dec"
    else -> ""
}

@chuja3
Copy link

chuja3 commented Jul 19, 2021

$months = [
			'1'	=> 'January',
			'2'	=> 'February',
			'3'	=> 'March',
			'4'	=> 'April',
			'5'	=> 'May',
			'6'	=> 'June',
			'7'	=> 'July',
			'8'	=> 'August',
			'9'	=> 'September',
			'10'	=> 'October',
			'11'	=> 'November',
			'12'	=> 'December'
];

@AIWintermuteAI
Copy link

superb

@shinhonggyu
Copy link

thanks

@erichbuelow
Copy link

Thank you sir!

@Hussein-miracle
Copy link

In javascript for fast access
const months = {
"01": "Jan",
"02": "Feb",
"03": "Mar",
"04": "Apr",
"05": "May",
"06": "Jun",
"07": "Jul",
"08": "Aug",
"09": "Sep",
// eslint-disable-next-line prettier/prettier
"10": "Oct",
// eslint-disable-next-line prettier/prettier
"11": "Nov",
// eslint-disable-next-line prettier/prettier
"12": "Dec",
};

@woterr
Copy link

woterr commented Oct 25, 2022

this man must be protected

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