I am building a full calendar with reactjs and i want to change the date of start and end which is included in dateInfo which is a dates set callback to know how many days and what are the data are there in calendar. Below are my code for handleDateSet function. let me know where i am doing wrong. setStartDate and setEndDate are state in the code and i am trying to change the timzone of dateInfo.start and end.
function handleDatesSet( dateInfo ) {
const start = moment
.tz( dateInfo.start, timeZone )
.format( 'YYYY-MM-DD' );
const end = moment
.tz( dateInfo.end, timeZone )
.format( 'YYYY-MM-DD' );
setStartDate( start );
setEndDate( end );
}
New contributor
sanjeev gwachha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.