pub fn new<'a, C: Context<'a>, T: Into<f64>>(
        cx: &mut C,
        value: T,
    ) -> Result<Handle<'a, JsDate>, DateError> {
        let env = cx.env().to_raw();
        let time = value.into();

        if time > JsDate::MAX_VALUE {
            return Err(DateError(DateErrorKind::Overflow));
        } else if time < JsDate::MIN_VALUE {
            return Err(DateError(DateErrorKind::Underflow));
        }

        let local = unsafe { neon_runtime::date::new_date(env, time) };
        let date = Handle::new_internal(JsDate(local));
        Ok(date)
    }
/// Creates a new Date. It errors when `value` is outside the range of valid JavaScript Date values. When `value`
/// is `NaN`, the operation will succeed but with an invalid Date
Creates a new Date. It errors when `value` is outside the range of valid JavaScript Date values. When `value`
is `NaN`, the operation will succeed but with an invalid Date
Creates a new Date . It errors when ` value ` is outside the range of valid JavaScript Date values . When ` value ` is ` NaN ` the operation will succeed but with an invalid Date
pub fn new<'a, C: Context<'a>, T: Into<f64>>(
        cx: &mut C,
        value: T,
    ) -> Result<Handle<'a, JsDate>, DateError> {
        let env = cx.env().to_raw();
        let time = value.into();
        if time > JsDate::MAX_VALUE {
            return Err(DateError(DateErrorKind::Overflow));
        } else if time < JsDate::MIN_VALUE {
            return Err(DateError(DateErrorKind::Underflow));
        }
        let local = unsafe { neon_runtime::date::new_date(env, time) };
        let date = Handle::new_internal(JsDate(local));
        Ok(date)
    }
pub fn new < ' a , C : Context < ' a > , T : Into < f64 > > ( cx : & mut C , value : T , ) -> Result < Handle < ' a , JsDate > , DateError > { let env = cx . env ( ) . to_raw ( ) ; let time = value . into ( ) ; if time > JsDate :: MAX_VALUE { return Err ( DateError ( DateErrorKind :: Overflow ) ) ; } else if time < JsDate :: MIN_VALUE { return Err ( DateError ( DateErrorKind :: Underflow ) ) ; } let local = unsafe { neon_runtime :: date :: new_date ( env , time ) } ; let date = Handle :: new_internal ( JsDate ( local ) ) ; Ok ( date ) }
Creates a new Date.
Creates a new Date .
cx
&mut C
value
T