- temp fix: form field items from JS config;
- fixed displaying times for call; - fixed reading saved flow;
This commit is contained in:
9
src/helpers/getTimeParsedFromString.js
Normal file
9
src/helpers/getTimeParsedFromString.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const getTimeParsedFromString = ( t ) => {
|
||||
let d = new Date();
|
||||
const time = t.match( /(\d+)(?::(\d\d))?\s*(p?)/ );
|
||||
d.setHours( parseInt( time[1]) + (time[3] ? 12 : 0) );
|
||||
d.setMinutes( parseInt( time[2]) || 0 );
|
||||
return d;
|
||||
}
|
||||
|
||||
export default getTimeParsedFromString;
|
||||
Reference in New Issue
Block a user