ASP.NET MVC Controls
DateTime Class
File
wijmo.js
Module
wijmo

Provides date and time utilities.

Methods

Methods

Static addDays

addDays(value: Date, days: number): Date

Gets a new Date that adds the specified number of days to a given Date.

Parameters
  • value: Date

    Original date.

  • days: number

    Number of days to add to the given date.

Returns
Date

Static addHours

addHours(value: Date, hours: number): Date

Gets a new Date that adds the specified number of hours to a given Date.

Parameters
  • value: Date

    Original date.

  • hours: number

    Number of hours to add to the given date.

Returns
Date

Static addMinutes

addMinutes(value: Date, minutes: number): Date

Gets a new Date that adds the specified number of minutes to a given Date.

Parameters
  • value: Date

    Original date.

  • minutes: number

    Number of minutes to add to the given date.

Returns
Date

Static addMonths

addMonths(value: Date, months: number): Date

Gets a new Date that adds the specified number of months to a given Date.

Parameters
  • value: Date

    Original date.

  • months: number

    Number of months to add to the given date.

Returns
Date

Static addSeconds

addSeconds(value: Date, seconds: number): Date

Gets a new Date that adds the specified number of seconds to a given Date.

Parameters
  • value: Date

    Original date.

  • seconds: number

    Number of seconds to add to the given date.

Returns
Date

Static addYears

addYears(value: Date, years: number): Date

Gets a new Date that adds the specified number of years to a given Date.

Parameters
  • value: Date

    Original date.

  • years: number

    Number of years to add to the given date.

Returns
Date

Static clone

clone(date: Date): Date

Creates a copy of a given Date object.

Parameters
  • date: Date

    Date object to copy.

Returns
Date

Static equals

equals(d1: Date, d2: Date): boolean

Returns true if two Date objects refer to the same date and time.

Parameters
  • d1: Date

    First date.

  • d2: Date

    Second date.

Returns
boolean

Static fromDateTime

fromDateTime(date: Date, time: Date): Date

Gets a Date object with the date and time set on two Date objects.

Parameters
  • date: Date

    Date object that contains the date (day/month/year).

  • time: Date

    Date object that contains the time (hour:minute:second).

Returns
Date

Static fromFiscal

fromFiscal(date: Date, govt: boolean): void

Converts a fiscal year date to a calendar date using the current culture.

Parameters
  • date: Date

    Fiscal year date.

  • govt: boolean

    Whether to use the government or corporate fiscal year.

Returns
void

Static newDate

newDate(): Date

Gets a new Date object set to today's date and no time portion.

Returns
Date

Static sameDate

sameDate(d1: Date, d2: Date): boolean

Returns true if two Date objects refer to the same date (ignoring time).

Parameters
  • d1: Date

    First date.

  • d2: Date

    Second date.

Returns
boolean

Static sameTime

sameTime(d1: Date, d2: Date): boolean

Returns true if two Date objects refer to the same time (ignoring date).

Parameters
  • d1: Date

    First date.

  • d2: Date

    Second date.

Returns
boolean

Static toFiscal

toFiscal(date: Date, govt: boolean): void

Converts a calendar date to a fiscal date using the current culture.

Parameters
  • date: Date

    Calendar date.

  • govt: boolean

    Whether to use the government or corporate fiscal year.

Returns
void

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback