Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kaushik1987/ba609eaf5496df837c9ca2f52c1f549b to your computer and use it in GitHub Desktop.
Save Kaushik1987/ba609eaf5496df837c9ca2f52c1f549b to your computer and use it in GitHub Desktop.
Previous implementation of getting month name.
private static getMonthName(month: number): string
{
if (month == null)
{
return 'XXX';
}
var date = new Date();
date.setMonth(month - 1); // The problem code.
return date.toLocaleString("en-us", { month: "short" });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment