Javascript - Get "Monday" from "mon" or "Tuesday" from "tue", etc -
is there correct way go grabbing name of day, when have short version, such following:
mon tue wed thu fri sat sun
i don't need actualy "date" or time or anything, need string full date name.
a simple associative array (read object) dictionary suffice:
var days = { 'mon': 'monday', 'tue': 'tuesday', 'wed': 'wednesday', 'thu': 'thursday', 'fri': 'friday', 'sat': 'saturday', 'sun': 'sunday' }
now, can access them follows:
var day = 'mon', full = days[day]; // full === 'monday';
Comments
Post a Comment