@skhemata/skhemata-form
Version:
Skhemata Form Web Component. This web component can be used as base web component when working with forms and inputs.
10 lines (8 loc) • 299 B
JavaScript
import assertString from './util/assertString';
import toDate from './toDate';
export default function isBefore(str, date = String(new Date())) {
assertString(str);
const comparison = toDate(date);
const original = toDate(str);
return !!(original && comparison && original < comparison);
}