(time)
| 6863 | |
| 6864 | it('allows pre init hook to transform data (gh-15839)', async function() { |
| 6865 | const timeStringToObject = (time) => { |
| 6866 | if (typeof time !== 'string') return time; |
| 6867 | const [hours, minutes] = time.split(':'); |
| 6868 | return { hours: parseInt(hours), minutes: parseInt(minutes) }; |
| 6869 | }; |
| 6870 | |
| 6871 | const timeSchema = new Schema({ |
| 6872 | hours: { type: Number, required: true }, |