| 1 | // Last module patch version validated against: 3.0.0
|
|---|
| 2 |
|
|---|
| 3 | // ---------------------------------------------------------------
|
|---|
| 4 | // Interfaces
|
|---|
| 5 | // ---------------------------------------------------------------
|
|---|
| 6 |
|
|---|
| 7 | /**
|
|---|
| 8 | * A D3 Time Interval
|
|---|
| 9 | */
|
|---|
| 10 | export interface TimeInterval {
|
|---|
| 11 | /**
|
|---|
| 12 | * Returns a new date representing the latest interval boundary date before or equal to date.
|
|---|
| 13 | * Equivalent to interval.floor, except it date is not specified, it defaults to the current time.
|
|---|
| 14 | * For example, d3.timeYear(date) and d3.timeYear.floor(date) are equivalent.
|
|---|
| 15 | *
|
|---|
| 16 | * For example, timeDay(date) typically returns 12:00 AM local time on the given date.
|
|---|
| 17 | *
|
|---|
| 18 | * This function is idempotent: if the specified date is already floored to the current interval,
|
|---|
| 19 | * a new date with an identical time is returned.
|
|---|
| 20 | * Furthermore, the returned date is the minimum expressible value of the associated interval,
|
|---|
| 21 | * such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date.
|
|---|
| 22 | *
|
|---|
| 23 | * Note that the == and === operators do not compare by value with Date objects,
|
|---|
| 24 | * and thus you cannot use them to tell whether the specified date has already been floored.
|
|---|
| 25 | * Instead, coerce to a number and then compare.
|
|---|
| 26 | *
|
|---|
| 27 | * This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
|---|
| 28 | *
|
|---|
| 29 | * @param date A date object.
|
|---|
| 30 | */
|
|---|
| 31 | (date?: Date): Date;
|
|---|
| 32 |
|
|---|
| 33 | /**
|
|---|
| 34 | * Returns a new date representing the latest interval boundary date before or equal to date.
|
|---|
| 35 | *
|
|---|
| 36 | * For example, timeDay.floor(date) typically returns 12:00 AM local time on the given date.
|
|---|
| 37 | *
|
|---|
| 38 | * This method is idempotent: if the specified date is already floored to the current interval,
|
|---|
| 39 | * a new date with an identical time is returned.
|
|---|
| 40 | * Furthermore, the returned date is the minimum expressible value of the associated interval,
|
|---|
| 41 | * such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date.
|
|---|
| 42 | *
|
|---|
| 43 | * Note that the == and === operators do not compare by value with Date objects,
|
|---|
| 44 | * and thus you cannot use them to tell whether the specified date has already been floored.
|
|---|
| 45 | * Instead, coerce to a number and then compare.
|
|---|
| 46 | *
|
|---|
| 47 | * This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
|---|
| 48 | *
|
|---|
| 49 | * @param date A date object.
|
|---|
| 50 | */
|
|---|
| 51 | floor(date: Date): Date;
|
|---|
| 52 |
|
|---|
| 53 | /**
|
|---|
| 54 | * Returns a new date representing the closest interval boundary date to date.
|
|---|
| 55 | *
|
|---|
| 56 | * For example, timeDay.round(date) typically returns 12:00 AM local time on the given date if it is on or before noon,
|
|---|
| 57 | * and 12:00 AM of the following day if it is after noon.
|
|---|
| 58 | *
|
|---|
| 59 | * This method is idempotent: if the specified date is already rounded to the current interval, a new date with an identical time is returned.
|
|---|
| 60 | *
|
|---|
| 61 | * @param date A date object.
|
|---|
| 62 | */
|
|---|
| 63 | round(date: Date): Date;
|
|---|
| 64 |
|
|---|
| 65 | /**
|
|---|
| 66 | * Returns a new date representing the earliest interval boundary date after or equal to date.
|
|---|
| 67 | *
|
|---|
| 68 | * For example, timeDay.ceil(date) typically returns 12:00 AM local time on the date following the given date.
|
|---|
| 69 | *
|
|---|
| 70 | * This method is idempotent: if the specified date is already ceilinged to the current interval,
|
|---|
| 71 | * a new date with an identical time is returned. Furthermore,
|
|---|
| 72 | * the returned date is the maximum expressible value of the associated interval,
|
|---|
| 73 | * such that interval.ceil(interval.ceil(date) + 1) returns the following interval boundary date.
|
|---|
| 74 | *
|
|---|
| 75 | * @param date A date object.
|
|---|
| 76 | */
|
|---|
| 77 | ceil(date: Date): Date;
|
|---|
| 78 |
|
|---|
| 79 | /**
|
|---|
| 80 | * Returns a new date equal to date plus step intervals.
|
|---|
| 81 | *
|
|---|
| 82 | * If step is not specified it defaults to 1.
|
|---|
| 83 | *
|
|---|
| 84 | * This method does not round the specified date to the interval. For example, if date is today at 5:34 PM,
|
|---|
| 85 | * then timeDay.offset(date, 1) returns 5:34 PM tomorrow (even if daylight saving changes!).
|
|---|
| 86 | *
|
|---|
| 87 | * @param date A date object.
|
|---|
| 88 | * @param step An optional number of steps to apply when calculating the offset date.
|
|---|
| 89 | * If step is negative, then the returned date will be before the specified date;
|
|---|
| 90 | * if step is zero, then a copy of the specified date is returned; if step is not an integer, it is floored.
|
|---|
| 91 | */
|
|---|
| 92 | offset(date: Date, step?: number): Date;
|
|---|
| 93 |
|
|---|
| 94 | /**
|
|---|
| 95 | * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).
|
|---|
| 96 | *
|
|---|
| 97 | * If step is specified, then every step-th boundary will be returned; for example,
|
|---|
| 98 | * for the timeDay interval a step of 2 will return every other day.
|
|---|
| 99 | * If step is not an integer, it is floored.
|
|---|
| 100 | *
|
|---|
| 101 | * The first date in the returned array is the earliest boundary after or equal to start;
|
|---|
| 102 | * subsequent dates are offset by step intervals and floored.
|
|---|
| 103 | * Thus, two overlapping ranges may be inconsistent.
|
|---|
| 104 | *
|
|---|
| 105 | * To make ranges consistent when a step is specified, use CountableInterval.every instead.
|
|---|
| 106 | *
|
|---|
| 107 | * @param start A start date object for the range.
|
|---|
| 108 | * @param stop A stop date object for the range.
|
|---|
| 109 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 110 | */
|
|---|
| 111 | range(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 112 |
|
|---|
| 113 | /**
|
|---|
| 114 | * Returns a new interval that is a filtered subset of this interval using the specified test function.
|
|---|
| 115 | *
|
|---|
| 116 | * @param test A test function which is passed a date and should return true if and only if
|
|---|
| 117 | * the specified date should be considered part of the interval.
|
|---|
| 118 | */
|
|---|
| 119 | filter(test: (date: Date) => boolean): TimeInterval;
|
|---|
| 120 | }
|
|---|
| 121 |
|
|---|
| 122 | /**
|
|---|
| 123 | * A D3 Countable Time Interval
|
|---|
| 124 | */
|
|---|
| 125 | export interface CountableTimeInterval extends TimeInterval {
|
|---|
| 126 | /**
|
|---|
| 127 | * Returns the number of interval boundaries after start (exclusive) and before or equal to end (inclusive).
|
|---|
| 128 | *
|
|---|
| 129 | * Note that this behavior is slightly different than interval.range,
|
|---|
| 130 | * because its purpose is to return the zero-based number of the specified end date relative to the specified start date.
|
|---|
| 131 | *
|
|---|
| 132 | * @param start A start date object.
|
|---|
| 133 | * @param end An end date object.
|
|---|
| 134 | */
|
|---|
| 135 | count(start: Date, end: Date): number;
|
|---|
| 136 | /**
|
|---|
| 137 | * Returns a filtered view of this interval representing every stepth date.
|
|---|
| 138 | *
|
|---|
| 139 | * The meaning of step is dependent on this interval’s parent interval as defined by the field function.
|
|---|
| 140 | *
|
|---|
| 141 | * For example, timeMinute.every(15) returns an interval representing every fifteen minutes,
|
|---|
| 142 | * starting on the hour: :00, :15, :30, :45, etc. Note that for some intervals,
|
|---|
| 143 | * the resulting dates may not be uniformly-spaced;
|
|---|
| 144 | * timeDay’s parent interval is timeMonth, and thus the interval number resets at the start of each month.
|
|---|
| 145 | *
|
|---|
| 146 | * If step is not valid, returns null. If step is one, returns this interval.
|
|---|
| 147 | *
|
|---|
| 148 | * This method can be used in conjunction with interval.range to ensure that two overlapping ranges are consistent.
|
|---|
| 149 | *
|
|---|
| 150 | * The returned filtered interval does not support interval.count. See also interval.filter.
|
|---|
| 151 | *
|
|---|
| 152 | * @param step Number of steps.
|
|---|
| 153 | */
|
|---|
| 154 | every(step: number): TimeInterval | null;
|
|---|
| 155 | }
|
|---|
| 156 |
|
|---|
| 157 | // ---------------------------------------------------------------
|
|---|
| 158 | // Custom (Countable)Interval Factories
|
|---|
| 159 | // ---------------------------------------------------------------
|
|---|
| 160 |
|
|---|
| 161 | /**
|
|---|
| 162 | * Constructs a new custom interval given the specified floor and offset functions.
|
|---|
| 163 | *
|
|---|
| 164 | * The returned custom interval is not countable, i.e. does not expose the methods "count(..)" and "every(...)".
|
|---|
| 165 | *
|
|---|
| 166 | * @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
|
|---|
| 167 | * @param offset An offset function which takes a date and an integer step as arguments and advances
|
|---|
| 168 | * the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
|---|
| 169 | */
|
|---|
| 170 | export function timeInterval(
|
|---|
| 171 | floor: (date: Date) => void,
|
|---|
| 172 | offset: (date: Date, step: number) => void,
|
|---|
| 173 | ): TimeInterval;
|
|---|
| 174 | /**
|
|---|
| 175 | * Constructs a new custom interval given the specified floor, offset and count functions.
|
|---|
| 176 | *
|
|---|
| 177 | * The returned custom interval is countable and exposes the methods "count(..)" and "every(...)".
|
|---|
| 178 | *
|
|---|
| 179 | * Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
|
|---|
| 180 | *
|
|---|
| 181 | * @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
|
|---|
| 182 | * @param offset An offset function which takes a date and an integer step as arguments and advances
|
|---|
| 183 | * the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
|---|
| 184 | * @param count A count function which takes a start date and an end date, already floored to the current interval,
|
|---|
| 185 | * and returns the number of boundaries between the start (exclusive) and end (inclusive).
|
|---|
| 186 | * Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
|
|---|
| 187 | * @param field An optional field function which takes a date, already floored to the current interval,
|
|---|
| 188 | * and returns the field value of the specified date,
|
|---|
| 189 | * corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary.
|
|---|
| 190 | * For example, for the timeDay interval, this returns the number of days since the start of the month.
|
|---|
| 191 | * If a field function is not specified, it defaults to counting the number of interval boundaries since
|
|---|
| 192 | * the UNIX epoch of January 1, 1970 UTC. The field function defines the behavior of interval.every.
|
|---|
| 193 | */
|
|---|
| 194 | export function timeInterval(
|
|---|
| 195 | floor: (date: Date) => void,
|
|---|
| 196 | offset: (date: Date, step: number) => void,
|
|---|
| 197 | count: (start: Date, end: Date) => number,
|
|---|
| 198 | field?: (date: Date) => number,
|
|---|
| 199 | ): CountableTimeInterval;
|
|---|
| 200 |
|
|---|
| 201 | // ---------------------------------------------------------------
|
|---|
| 202 | // Built-In Factories and Date Array Creators
|
|---|
| 203 | // ---------------------------------------------------------------
|
|---|
| 204 |
|
|---|
| 205 | // local time ----------------------------------------------------------
|
|---|
| 206 |
|
|---|
| 207 | /**
|
|---|
| 208 | * Milliseconds Interval in Local Time; the shortest available time unit.
|
|---|
| 209 | */
|
|---|
| 210 | export const timeMillisecond: CountableTimeInterval;
|
|---|
| 211 |
|
|---|
| 212 | /**
|
|---|
| 213 | * This is a convenience alias for timeMillisecond.range(...).
|
|---|
| 214 | *
|
|---|
| 215 | * @param start A start date object for the range.
|
|---|
| 216 | * @param stop A stop date object for the range.
|
|---|
| 217 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 218 | */
|
|---|
| 219 | export function timeMilliseconds(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 220 |
|
|---|
| 221 | /**
|
|---|
| 222 | * Seconds Interval in Local Time; seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
|---|
| 223 | */
|
|---|
| 224 | export const timeSecond: CountableTimeInterval;
|
|---|
| 225 |
|
|---|
| 226 | /**
|
|---|
| 227 | * This is a convenience alias for timeSecond.range(...).
|
|---|
| 228 | *
|
|---|
| 229 | * @param start A start date object for the range.
|
|---|
| 230 | * @param stop A stop date object for the range.
|
|---|
| 231 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 232 | */
|
|---|
| 233 | export function timeSeconds(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 234 |
|
|---|
| 235 | /**
|
|---|
| 236 | * Minutes Interval in Local Time; minutes (e.g., 01:02:00 AM); 60 seconds. Note that ECMAScript ignores leap seconds.
|
|---|
| 237 | */
|
|---|
| 238 | export const timeMinute: CountableTimeInterval;
|
|---|
| 239 |
|
|---|
| 240 | /**
|
|---|
| 241 | * This is a convenience alias for timeMinute.range(...).
|
|---|
| 242 | *
|
|---|
| 243 | * @param start A start date object for the range.
|
|---|
| 244 | * @param stop A stop date object for the range.
|
|---|
| 245 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 246 | */
|
|---|
| 247 | export function timeMinutes(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 248 |
|
|---|
| 249 | /**
|
|---|
| 250 | * Hours Interval in Local Time; Hours (e.g., 01:00 AM); 60 minutes.
|
|---|
| 251 | *
|
|---|
| 252 | * Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving.
|
|---|
| 253 | */
|
|---|
| 254 | export const timeHour: CountableTimeInterval;
|
|---|
| 255 |
|
|---|
| 256 | /**
|
|---|
| 257 | * This is a convenience alias for timeHour.range(...).
|
|---|
| 258 | *
|
|---|
| 259 | * @param start A start date object for the range.
|
|---|
| 260 | * @param stop A stop date object for the range.
|
|---|
| 261 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 262 | */
|
|---|
| 263 | export function timeHours(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 264 |
|
|---|
| 265 | /**
|
|---|
| 266 | * Days Interval in Local Time; days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours.
|
|---|
| 267 | * Days in local time may range from 23 to 25 hours due to daylight saving.
|
|---|
| 268 | */
|
|---|
| 269 | export const timeDay: CountableTimeInterval;
|
|---|
| 270 |
|
|---|
| 271 | /**
|
|---|
| 272 | * This is a convenience alias for timeDay.range(...).
|
|---|
| 273 | *
|
|---|
| 274 | * @param start A start date object for the range.
|
|---|
| 275 | * @param stop A stop date object for the range.
|
|---|
| 276 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 277 | */
|
|---|
| 278 | export function timeDays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 279 |
|
|---|
| 280 | /**
|
|---|
| 281 | * Week Interval in Local Time. Alias for sunday; 7 days and typically 168 hours.
|
|---|
| 282 | *
|
|---|
| 283 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 284 | */
|
|---|
| 285 | export const timeWeek: CountableTimeInterval;
|
|---|
| 286 |
|
|---|
| 287 | /**
|
|---|
| 288 | * This is a convenience alias for timeWeek.range(...).
|
|---|
| 289 | *
|
|---|
| 290 | * @param start A start date object for the range.
|
|---|
| 291 | * @param stop A stop date object for the range.
|
|---|
| 292 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 293 | */
|
|---|
| 294 | export function timeWeeks(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 295 |
|
|---|
| 296 | /**
|
|---|
| 297 | * Week Interval for Sunday-based weeks in Local Time (e.g., February 5, 2012 at 12:00 AM).
|
|---|
| 298 | * 7 days and typically 168 hours.
|
|---|
| 299 | *
|
|---|
| 300 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 301 | */
|
|---|
| 302 | export const timeSunday: CountableTimeInterval;
|
|---|
| 303 |
|
|---|
| 304 | /**
|
|---|
| 305 | * This is a convenience alias for timeSunday.range(...).
|
|---|
| 306 | *
|
|---|
| 307 | * @param start A start date object for the range.
|
|---|
| 308 | * @param stop A stop date object for the range.
|
|---|
| 309 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 310 | */
|
|---|
| 311 | export function timeSundays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 312 |
|
|---|
| 313 | /**
|
|---|
| 314 | * Week Interval for Monday-based weeks in Local Time (e.g., February 6, 2012 at 12:00 AM).
|
|---|
| 315 | * 7 days and typically 168 hours.
|
|---|
| 316 | *
|
|---|
| 317 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 318 | */
|
|---|
| 319 | export const timeMonday: CountableTimeInterval;
|
|---|
| 320 |
|
|---|
| 321 | /**
|
|---|
| 322 | * This is a convenience alias for timeMonday.range(...).
|
|---|
| 323 | *
|
|---|
| 324 | * @param start A start date object for the range.
|
|---|
| 325 | * @param stop A stop date object for the range.
|
|---|
| 326 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 327 | */
|
|---|
| 328 | export function timeMondays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 329 |
|
|---|
| 330 | /**
|
|---|
| 331 | * Week Interval for Tuesday-based weeks in Local Time (e.g., February 7, 2012 at 12:00 AM).
|
|---|
| 332 | * 7 days and typically 168 hours.
|
|---|
| 333 | *
|
|---|
| 334 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 335 | */
|
|---|
| 336 | export const timeTuesday: CountableTimeInterval;
|
|---|
| 337 |
|
|---|
| 338 | /**
|
|---|
| 339 | * This is a convenience alias for timeTuesday.range(...).
|
|---|
| 340 | *
|
|---|
| 341 | * @param start A start date object for the range.
|
|---|
| 342 | * @param stop A stop date object for the range.
|
|---|
| 343 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 344 | */
|
|---|
| 345 | export function timeTuesdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 346 |
|
|---|
| 347 | /**
|
|---|
| 348 | * Week Interval for Wednesday-based weeks in Local Time (e.g., February 8, 2012 at 12:00 AM).
|
|---|
| 349 | * 7 days and typically 168 hours.
|
|---|
| 350 | *
|
|---|
| 351 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 352 | */
|
|---|
| 353 | export const timeWednesday: CountableTimeInterval;
|
|---|
| 354 |
|
|---|
| 355 | /**
|
|---|
| 356 | * This is a convenience alias for timeWednesday.range(...).
|
|---|
| 357 | *
|
|---|
| 358 | * @param start A start date object for the range.
|
|---|
| 359 | * @param stop A stop date object for the range.
|
|---|
| 360 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 361 | */
|
|---|
| 362 | export function timeWednesdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 363 |
|
|---|
| 364 | /**
|
|---|
| 365 | * Week Interval for Thursday-based weeks in Local Time (e.g., February 9, 2012 at 12:00 AM).
|
|---|
| 366 | * 7 days and typically 168 hours.
|
|---|
| 367 | *
|
|---|
| 368 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 369 | */
|
|---|
| 370 | export const timeThursday: CountableTimeInterval;
|
|---|
| 371 |
|
|---|
| 372 | /**
|
|---|
| 373 | * This is a convenience alias for timeThursday.range(...).
|
|---|
| 374 | *
|
|---|
| 375 | * @param start A start date object for the range.
|
|---|
| 376 | * @param stop A stop date object for the range.
|
|---|
| 377 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 378 | */
|
|---|
| 379 | export function timeThursdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 380 |
|
|---|
| 381 | /**
|
|---|
| 382 | * Week Interval for Friday-based weeks in Local Time (e.g., February 10, 2012 at 12:00 AM).
|
|---|
| 383 | * 7 days and typically 168 hours.
|
|---|
| 384 | *
|
|---|
| 385 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 386 | */
|
|---|
| 387 | export const timeFriday: CountableTimeInterval;
|
|---|
| 388 |
|
|---|
| 389 | /**
|
|---|
| 390 | * This is a convenience alias for timeFriday.range(...).
|
|---|
| 391 | *
|
|---|
| 392 | * @param start A start date object for the range.
|
|---|
| 393 | * @param stop A stop date object for the range.
|
|---|
| 394 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 395 | */
|
|---|
| 396 | export function timeFridays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 397 |
|
|---|
| 398 | /**
|
|---|
| 399 | * Week Interval for Saturday-based weeks in Local Time (e.g., February 11, 2012 at 12:00 AM).
|
|---|
| 400 | * 7 days and typically 168 hours.
|
|---|
| 401 | *
|
|---|
| 402 | * Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
|---|
| 403 | */
|
|---|
| 404 | export const timeSaturday: CountableTimeInterval;
|
|---|
| 405 |
|
|---|
| 406 | /**
|
|---|
| 407 | * This is a convenience alias for timeSaturday.range(...).
|
|---|
| 408 | *
|
|---|
| 409 | * @param start A start date object for the range.
|
|---|
| 410 | * @param stop A stop date object for the range.
|
|---|
| 411 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 412 | */
|
|---|
| 413 | export function timeSaturdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 414 |
|
|---|
| 415 | /**
|
|---|
| 416 | * Month Interval in Local Time; months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
|---|
| 417 | */
|
|---|
| 418 | export const timeMonth: CountableTimeInterval;
|
|---|
| 419 |
|
|---|
| 420 | /**
|
|---|
| 421 | * This is a convenience alias for timeMonth.range(...).
|
|---|
| 422 | *
|
|---|
| 423 | * @param start A start date object for the range.
|
|---|
| 424 | * @param stop A stop date object for the range.
|
|---|
| 425 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 426 | */
|
|---|
| 427 | export function timeMonths(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 428 |
|
|---|
| 429 | /**
|
|---|
| 430 | * Year Interval in Local Time; years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
|---|
| 431 | */
|
|---|
| 432 | export const timeYear: CountableTimeInterval;
|
|---|
| 433 |
|
|---|
| 434 | /**
|
|---|
| 435 | * This is a convenience alias for timeYear.range(...).
|
|---|
| 436 | *
|
|---|
| 437 | * @param start A start date object for the range.
|
|---|
| 438 | * @param stop A stop date object for the range.
|
|---|
| 439 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 440 | */
|
|---|
| 441 | export function timeYears(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 442 |
|
|---|
| 443 | // utc Coordinated Universal Time ----------------------------------------------------------
|
|---|
| 444 |
|
|---|
| 445 | /**
|
|---|
| 446 | * Milliseconds Interval in Coordinated Universal Time (UTC); the shortest available time unit.
|
|---|
| 447 | */
|
|---|
| 448 | export const utcMillisecond: CountableTimeInterval;
|
|---|
| 449 |
|
|---|
| 450 | /**
|
|---|
| 451 | * This is a convenience alias for utcMillisecond.range(...).
|
|---|
| 452 | *
|
|---|
| 453 | * @param start A start date object for the range.
|
|---|
| 454 | * @param stop A stop date object for the range.
|
|---|
| 455 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 456 | */
|
|---|
| 457 | export function utcMilliseconds(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 458 |
|
|---|
| 459 | /**
|
|---|
| 460 | * Seconds Interval in Coordinated Universal Time (UTC); seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
|---|
| 461 | */
|
|---|
| 462 | export const utcSecond: CountableTimeInterval;
|
|---|
| 463 |
|
|---|
| 464 | /**
|
|---|
| 465 | * This is a convenience alias for utcSecond.range(...).
|
|---|
| 466 | *
|
|---|
| 467 | * @param start A start date object for the range.
|
|---|
| 468 | * @param stop A stop date object for the range.
|
|---|
| 469 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 470 | */
|
|---|
| 471 | export function utcSeconds(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 472 |
|
|---|
| 473 | /**
|
|---|
| 474 | * Minutes Interval in Coordinated Universal Time (UTC); minutes (e.g., 01:02:00 AM); 60 seconds.
|
|---|
| 475 | * Note that ECMAScript ignores leap seconds.
|
|---|
| 476 | */
|
|---|
| 477 | export const utcMinute: CountableTimeInterval;
|
|---|
| 478 |
|
|---|
| 479 | /**
|
|---|
| 480 | * This is a convenience alias for utcMinute.range(...).
|
|---|
| 481 | *
|
|---|
| 482 | * @param start A start date object for the range.
|
|---|
| 483 | * @param stop A stop date object for the range.
|
|---|
| 484 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 485 | */
|
|---|
| 486 | export function utcMinutes(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 487 |
|
|---|
| 488 | /**
|
|---|
| 489 | * Hours Interval in Coordinated Universal Time (UTC); Hours (e.g., 01:00 AM); 60 minutes.
|
|---|
| 490 | */
|
|---|
| 491 | export const utcHour: CountableTimeInterval;
|
|---|
| 492 |
|
|---|
| 493 | /**
|
|---|
| 494 | * This is a convenience alias for utcHour.range(...).
|
|---|
| 495 | *
|
|---|
| 496 | * @param start A start date object for the range.
|
|---|
| 497 | * @param stop A stop date object for the range.
|
|---|
| 498 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 499 | */
|
|---|
| 500 | export function utcHours(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 501 |
|
|---|
| 502 | /**
|
|---|
| 503 | * Days Interval in Coordinated Universal Time (UTC); days (e.g., February 7, 2012 at 12:00 AM); 24 hours.
|
|---|
| 504 | */
|
|---|
| 505 | export const utcDay: CountableTimeInterval;
|
|---|
| 506 |
|
|---|
| 507 | /**
|
|---|
| 508 | * This is a convenience alias for utcDay.range(...).
|
|---|
| 509 | *
|
|---|
| 510 | * @param start A start date object for the range.
|
|---|
| 511 | * @param stop A stop date object for the range.
|
|---|
| 512 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 513 | */
|
|---|
| 514 | export function utcDays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 515 |
|
|---|
| 516 | /**
|
|---|
| 517 | * Week Interval in Local Time. Alias for sunday; 7 days and 168 hours.
|
|---|
| 518 | */
|
|---|
| 519 | export const utcWeek: CountableTimeInterval;
|
|---|
| 520 |
|
|---|
| 521 | /**
|
|---|
| 522 | * This is a convenience alias for utcWeek.range(...).
|
|---|
| 523 | *
|
|---|
| 524 | * @param start A start date object for the range.
|
|---|
| 525 | * @param stop A stop date object for the range.
|
|---|
| 526 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 527 | */
|
|---|
| 528 | export function utcWeeks(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 529 |
|
|---|
| 530 | /**
|
|---|
| 531 | * Week Interval for Sunday-based weeks in Coordinated Universal Time (UTC) (e.g., February 5, 2012 at 12:00 AM).
|
|---|
| 532 | * 7 days and 168 hours.
|
|---|
| 533 | */
|
|---|
| 534 | export const utcSunday: CountableTimeInterval;
|
|---|
| 535 |
|
|---|
| 536 | /**
|
|---|
| 537 | * This is a convenience alias for utcSunday.range(...).
|
|---|
| 538 | *
|
|---|
| 539 | * @param start A start date object for the range.
|
|---|
| 540 | * @param stop A stop date object for the range.
|
|---|
| 541 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 542 | */
|
|---|
| 543 | export function utcSundays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 544 |
|
|---|
| 545 | /**
|
|---|
| 546 | * Week Interval for Monday-based weeks in Coordinated Universal Time (UTC) (e.g., February 6, 2012 at 12:00 AM).
|
|---|
| 547 | * 7 days and 168 hours.
|
|---|
| 548 | */
|
|---|
| 549 | export const utcMonday: CountableTimeInterval;
|
|---|
| 550 |
|
|---|
| 551 | /**
|
|---|
| 552 | * This is a convenience alias for utcMonday.range(...).
|
|---|
| 553 | *
|
|---|
| 554 | * @param start A start date object for the range.
|
|---|
| 555 | * @param stop A stop date object for the range.
|
|---|
| 556 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 557 | */
|
|---|
| 558 | export function utcMondays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 559 |
|
|---|
| 560 | /**
|
|---|
| 561 | * Week Interval for Tuesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 7, 2012 at 12:00 AM).
|
|---|
| 562 | * 7 days and 168 hours.
|
|---|
| 563 | */
|
|---|
| 564 | export const utcTuesday: CountableTimeInterval;
|
|---|
| 565 |
|
|---|
| 566 | /**
|
|---|
| 567 | * This is a convenience alias for utcTuesday.range(...).
|
|---|
| 568 | *
|
|---|
| 569 | * @param start A start date object for the range.
|
|---|
| 570 | * @param stop A stop date object for the range.
|
|---|
| 571 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 572 | */
|
|---|
| 573 | export function utcTuesdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 574 |
|
|---|
| 575 | /**
|
|---|
| 576 | * Week Interval for Wednesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 8, 2012 at 12:00 AM).
|
|---|
| 577 | * 7 days and 168 hours.
|
|---|
| 578 | */
|
|---|
| 579 | export const utcWednesday: CountableTimeInterval;
|
|---|
| 580 |
|
|---|
| 581 | /**
|
|---|
| 582 | * This is a convenience alias for utcWednesday.range(...).
|
|---|
| 583 | *
|
|---|
| 584 | * @param start A start date object for the range.
|
|---|
| 585 | * @param stop A stop date object for the range.
|
|---|
| 586 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 587 | */
|
|---|
| 588 | export function utcWednesdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 589 |
|
|---|
| 590 | /**
|
|---|
| 591 | * Week Interval for Thursday-based weeks in Coordinated Universal Time (UTC) (e.g., February 9, 2012 at 12:00 AM).
|
|---|
| 592 | * 7 days and 168 hours.
|
|---|
| 593 | */
|
|---|
| 594 | export const utcThursday: CountableTimeInterval;
|
|---|
| 595 |
|
|---|
| 596 | /**
|
|---|
| 597 | * This is a convenience alias for utcThursday.range(...).
|
|---|
| 598 | *
|
|---|
| 599 | * @param start A start date object for the range.
|
|---|
| 600 | * @param stop A stop date object for the range.
|
|---|
| 601 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 602 | */
|
|---|
| 603 | export function utcThursdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 604 |
|
|---|
| 605 | /**
|
|---|
| 606 | * Week Interval for Friday-based weeks in Coordinated Universal Time (UTC) (e.g., February 10, 2012 at 12:00 AM).
|
|---|
| 607 | * 7 days and 168 hours.
|
|---|
| 608 | */
|
|---|
| 609 | export const utcFriday: CountableTimeInterval;
|
|---|
| 610 |
|
|---|
| 611 | /**
|
|---|
| 612 | * This is a convenience alias for utcFriday.range(...).
|
|---|
| 613 | *
|
|---|
| 614 | * @param start A start date object for the range.
|
|---|
| 615 | * @param stop A stop date object for the range.
|
|---|
| 616 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 617 | */
|
|---|
| 618 | export function utcFridays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 619 |
|
|---|
| 620 | /**
|
|---|
| 621 | * Week Interval for Saturday-based weeks in Coordinated Universal Time (UTC) (e.g., February 11, 2012 at 12:00 AM).
|
|---|
| 622 | * 7 days and 168 hours.
|
|---|
| 623 | */
|
|---|
| 624 | export const utcSaturday: CountableTimeInterval;
|
|---|
| 625 |
|
|---|
| 626 | /**
|
|---|
| 627 | * This is a convenience alias for utcSaturday.range(...).
|
|---|
| 628 | *
|
|---|
| 629 | * @param start A start date object for the range.
|
|---|
| 630 | * @param stop A stop date object for the range.
|
|---|
| 631 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 632 | */
|
|---|
| 633 | export function utcSaturdays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 634 |
|
|---|
| 635 | /**
|
|---|
| 636 | * Month Interval in Coordinated Universal Time (UTC); months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
|---|
| 637 | */
|
|---|
| 638 | export const utcMonth: CountableTimeInterval;
|
|---|
| 639 |
|
|---|
| 640 | /**
|
|---|
| 641 | * This is a convenience alias for utcMonth.range(...).
|
|---|
| 642 | *
|
|---|
| 643 | * @param start A start date object for the range.
|
|---|
| 644 | * @param stop A stop date object for the range.
|
|---|
| 645 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 646 | */
|
|---|
| 647 | export function utcMonths(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 648 |
|
|---|
| 649 | /**
|
|---|
| 650 | * Year Interval in Coordinated Universal Time (UTC); years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
|---|
| 651 | */
|
|---|
| 652 | export const utcYear: CountableTimeInterval;
|
|---|
| 653 |
|
|---|
| 654 | /**
|
|---|
| 655 | * This is a convenience alias for utcYear.range(...).
|
|---|
| 656 | *
|
|---|
| 657 | * @param start A start date object for the range.
|
|---|
| 658 | * @param stop A stop date object for the range.
|
|---|
| 659 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 660 | */
|
|---|
| 661 | export function utcYears(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 662 |
|
|---|
| 663 | /**
|
|---|
| 664 | * Like d3.utcDay, except it counts days since the UNIX epoch (January 1, 1970) such that interval.every returns uniformly-spaced dates rather than varying based on day-of-month.
|
|---|
| 665 | */
|
|---|
| 666 | export const unixDay: CountableTimeInterval;
|
|---|
| 667 |
|
|---|
| 668 | /**
|
|---|
| 669 | * This is a convenience alias for unixDay.range(...).
|
|---|
| 670 | *
|
|---|
| 671 | * @param start A start date object for the range.
|
|---|
| 672 | * @param stop A stop date object for the range.
|
|---|
| 673 | * @param step An optional number of steps to apply when calculating the dates in the range.
|
|---|
| 674 | */
|
|---|
| 675 | export function unixDays(start: Date, stop: Date, step?: number): Date[];
|
|---|
| 676 |
|
|---|
| 677 | /**
|
|---|
| 678 | * Equivalent to d3.utcTicks, but in local time.
|
|---|
| 679 | */
|
|---|
| 680 | export function timeTicks(start: Date, stop: Date, count: number): Date[];
|
|---|
| 681 |
|
|---|
| 682 | /**
|
|---|
| 683 | * Returns the time interval that would be used by d3.timeTicks given the same arguments.
|
|---|
| 684 | */
|
|---|
| 685 | export function timeTickInterval(start: Date, stop: Date, count: number): TimeInterval | null;
|
|---|
| 686 |
|
|---|
| 687 | /**
|
|---|
| 688 | * Returns an array of approximately count dates at regular intervals between start and stop (inclusive).
|
|---|
| 689 | * If stop is before start, dates are returned in reverse chronological order; otherwise dates are returned in chronological order.
|
|---|
| 690 | */
|
|---|
| 691 | export function utcTicks(start: Date, stop: Date, count: number): Date[];
|
|---|
| 692 |
|
|---|
| 693 | /**
|
|---|
| 694 | * Returns the time interval that would be used by d3.utcTicks given the same arguments.
|
|---|
| 695 | * If there is no associated interval, such as when start or stop is invalid, returns null.
|
|---|
| 696 | */
|
|---|
| 697 | export function utcTickInterval(start: Date, stop: Date, count: number): TimeInterval | null;
|
|---|