Protected
_timeReadonly
icalclassThe class identifier.
Readonly
icaltypeThe type name, to be used in the jCal object.
Optional
zoneThe timezone for this time.
Static
Readonly
DEFAULT_The default weekday for the WKST part.
ICAL.Time.MONDAY
Static
Readonly
FRIDAYStatic
Readonly
MONDAYStatic
Readonly
SATURDAYStatic
Readonly
SUNDAYStatic
Readonly
THURSDAYStatic
Readonly
TUESDAYStatic
Readonly
WEDNESDAYStatic
_dowStatic
_wnStatic
daysThe days that have passed in the year after a given month. The array has two members, one being an array of passed days for non-leap years, the other analog for leap years.
var isLeapYear = ICAL.Time.isLeapYear(year);
var passedDays = ICAL.Time.daysInYearPassedMonth[isLeapYear][month];
Static
fromStatic
epochAdds the duration to the current time. The instance is modified in place.
The duration to add
Adjust the date/time by the given offset
The extra amount of days
The extra amount of hours
The extra amount of minutes
The extra amount of seconds
Optional
aTime: Required<TimeData>The time to adjust, defaults to the current instance.
Compares the ICAL.Time instance with another one.
-1, 0 or 1 for less/equal/greater
Returns a copy of the current date/time, shifted to the end of the week. The resulting ICAL.Time instance is of icaltype date, even if this is a date-time.
Optional
aWeekStart: WeekDayThe week start weekday, defaults to SUNDAY
The end of the week (cloned)
Checks if current time is the nth weekday, relative to the current month. Will always return false when rule resolves outside of current month.
Day of week to check
Relative position
True, if it is the nth weekday
Finds the nthWeekDay relative to the current month (not day). The returned value is a day relative the month that this month belongs to so 1 would indicate the first of the month and 40 would indicate a day in the following month.
Day of the week see the day name constants
Nth occurrence of a given week day values of 1 and 0 both indicate the first weekday of that type. aPos may be either positive or negative
numeric value indicating a day relative to the current month of this time object
Reset the time instance to the given date/time values.
The year to set
The month to set
The day to set
The hour to set
The minute to set
The second to set
Optional
timezone: TimezoneThe timezone to set
First calculates the start of the week, then returns the day of year for this date. If the day falls into the previous year, the day is zero or negative.
Optional
aFirstDayOfWeek: WeekDayThe week start weekday, defaults to SUNDAY
The calculated day of year
Returns a copy of the current date/time, rewound to the start of the week. The resulting ICAL.Time instance is of icaltype date, even if this is a date-time.
Optional
aWeekStart: WeekDayThe week start weekday, defaults to SUNDAY
The start of the week (cloned)
Converts time to into Object which can be serialized then re-created using the constructor.
// toJSON will automatically be called
var json = JSON.stringify(mytime);
var deserialized = JSON.parse(json);
var time = new ICAL.Time(deserialized);
Calculates the ISO 8601 week number. The first week of a year is the week that contains the first Thursday. The year can have 53 weeks, if January 1st is a Friday.
Note there are regions where the first week of the year is the one that starts on January 1st, which may offset the week number. Also, if a different week start is specified, this will also affect the week number.
The weekday the week starts with
The ISO week number
ICAL.Time.weekOneStarts
Static
_cmp_Static
daysStatic
fromReturns a new ICAL.VCardTime instance from a date and/or time string.
The string to create from
Optional
aIcalType: "date-and-or-time" | "date" | "date-time" | "time"The type for this instance, e.g. date-and-or-time
The date/time instance
Static
fromStatic
fromReturns a new ICAL.Time instance from a date-time string, e.g 2015-01-02T03:04:05. If a property is specified, the timezone is set up from the property's TZID parameter.
The string to create from
Optional
prop: PropertyThe property the date belongs to
The date/time instance
Static
fromStatic
fromJSDateStatic
fromStatic
fromStatic
getStatic
isStatic
nowStatic
weekGenerated using TypeDoc
Describes a vCard time, which has slight differences to the ICAL.Time. Properties can be null if not specified, for example for dates with reduced accuracy or truncation.
Note that currently not all methods are correctly re-implemented for VCardTime. For example, comparison will have undefined results when some members are null.
Also, normalization is not yet implemented for this class!
Alias
ICAL.VCardTime