Home > Software engineering >  React accessing props object startDate and endDate
React accessing props object startDate and endDate

Time:03-10

Please, I want to access startDate and endDate. How can I do that?

enter image description here

CodePudding user response:

days[1].props.startDate to access start date days[1].props.endDate to access end date

CodePudding user response:

days is an array of react elements with props date,startDate, ... as a instance of Moment class. To display you need to format it. Example:

moment(days[1].props.startDate).format("DD/MM/YYYY")

CodePudding user response:

enter image description here

It is not working. I got an object. I need to get date.

  • Related