0

I have user inputs of meeting_time which is javascript Date (calendar select) and meeting_time string (select dropdown option)

var userTime = meeting_time ? meeting_time.label.split(' -')[0] : null var userDate = moment(meeting_date).format("YYYY-MM-DD"); 

How Do I converting those variable to moment.js object with specific timezone

For example,

  • meeting_date is Thu Jul 12 2018 12:00:00 GMT+0300 (MSK)
  • meeting_time is 15:00 - 15:30

I want to get moment _d Thu Jul 12 2018 20:00:00 GMT+0800 (UTC +3 to UTC +8)

1 Answer 1

1

You can set the hour and minute in the date.

const [hour, minute] = userTime.split(':'); moment(meeting_date).hour(hour).minute(minute).toDate(); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.