javascript get current month start and end date
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
javascript get current month start and end date
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
javascript get month name from number
export const GetDatMonthFromDate=(dateSplit:any)=>{
dateSplit = dateSplit.split('-');
var monthShortNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
];
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const date = new Date(dateSplit[0], dateSplit[1], dateSplit[2]); // 2020-06-21
return dateSplit[2]+' '+ monthShortNames[date.getMonth()];
}
GetDatMonthFromDate('2021-07-2');
//output = 2 sep;
// if you wanty full month then use months instead of monthShortNames on
// line number 9
//return dateSplit[2]+' '+ months[date.getMonth()]; output == 2 September
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us