Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
return (
<div>
<p>
Time Provided:
<span>{this.state.time}</span>
</p>
</div>
);
}
}
}
/**
* Converts a date/time string in the given format to a moment object.
* @param {string} date - The date string for the conversion.
* @param {string} time - The time string for the conversion.
* @param {string} dateformat - The format of the date and time strings.
* @param {boolean} hasSeconds - If true seconds will be converted
* @return {object} - The moment object representing the given date and time.
*/
static convertDateTimeStringToMomentObject(date, time, dateformat, hasSeconds) {
return DateTimeUtils.updateTime(DateUtil.createSafeDate(DateUtil.convertToISO8601(date, dateformat)), time, hasSeconds);
}
}
DateTimeUtils.FORMAT_12_HOUR = TimeUtil.FORMAT_12_HOUR;
DateTimeUtils.FORMAT_24_HOUR = TimeUtil.FORMAT_24_HOUR;
export default DateTimeUtils;
render() {
return (
<div>
<p>
Time Provided:
<span>{this.state.time}</span>
</p>
</div>
);
}
}
render() {
return (
<div>
<p>
Time Provided:
<span>{this.state.time}</span>
</p>
</div>
);
}
}
/**
* Converts a date/time string in the given format to a moment object.
* @param {string} date - The date string for the conversion.
* @param {string} time - The time string for the conversion.
* @param {string} dateformat - The format of the date and time strings.
* @param {boolean} hasSeconds - If true seconds will be converted
* @return {object} - The moment object representing the given date and time.
*/
static convertDateTimeStringToMomentObject(date, time, dateformat, hasSeconds) {
return DateTimeUtils.updateTime(DateUtil.createSafeDate(DateUtil.convertToISO8601(date, dateformat)), time, hasSeconds);
}
}
DateTimeUtils.FORMAT_12_HOUR = TimeUtil.FORMAT_12_HOUR;
DateTimeUtils.FORMAT_24_HOUR = TimeUtil.FORMAT_24_HOUR;
export default DateTimeUtils;