momentjs subtract times from 22h til 6 h code example Example: moment js subtract years let min_date = moment().subtract(18, 'years');