Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get startTime element value in an array

May I know how to get the startTime value in the array? I use this code {props.StartTime} it doesn’t work. I want to get the StartTime result is Thu Dec 22 2022 21:20:00 GMT+0800 (Malaysia Time)

img1

This is my original code what I do, only {props.StartTime} is doesn’t work:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

const contentTemplate = props => {
    return (
      <div className="template-wrap">
        <div class="e-date-time">
          <div class="e-date-time-icon e-icons"></div>
          <div class="e-date-time-wrapper e-text-ellipsis">
            <div class="e-date-time-details e-text-ellipsis">
              {props.StartTime}
            </div>
          </div>
        </div>
        <div class="e-location">
          <div class="e-location-icon e-icons"></div>
          <div class="e-location-details e-text-ellipsis">{props.Location}</div>
        </div>
        <div class="e-resource">
          <div class="e-resource-icon e-icons"></div>
          <div class="e-resource-details e-text-ellipsis">
            {props.DoctorList}
          </div>
        </div>
      </div>
    );
  };

Hope someone can guide me on how to solve it. Thanks.

>Solution :

It seems that these might be Date objects so perhaps try toString():

{props.StartTime.toString()}

For formatted output to match the locale perhaps reference MDN list of Date to string methods.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading