@foxglove/xmlrpc
Version:
TypeScript library implementing an XMLRPC client and server with pluggable server backend
53 lines • 1.84 kB
TypeScript
export declare type DateFormatterOptions = {
colons?: boolean;
hyphens?: boolean;
ms?: boolean;
};
export declare class DateFormatter {
private _colons;
private _hyphens;
private _ms;
static ISO8601: RegExp;
constructor(options?: DateFormatterOptions);
/**
* Converts a date time stamp following the ISO8601 format to a JavaScript Date
* object.
*
* @param {string} time - String representation of timestamp.
* @return {Date} - Date object from timestamp.
*/
decodeIso8601(time: string): Date;
/**
* Converts a JavaScript Date object to an ISO8601 timestamp.
*
* @param {Date} date - Date object.
* @return {string} - String representation of timestamp.
*/
encodeIso8601(date: Date): string;
/**
* Helper function to get the current timezone to default decoding to
* rather than UTC. (for backward compatibility)
*
* @return {string} - in the format /Z|[+-]\d{2}:\d{2}/
*/
static formatCurrentOffset(d?: Date): string;
/**
* Helper function to pad the digits with 0s to meet date formatting
* requirements.
*
* @param {number} digit - The number to pad.
* @param {number} length - Length of digit string, prefix with 0s if not
* already length.
* @return {string} - String with the padded digit
*/
static zeroPad(digit: number, length: number): string;
/**
* Helper function to get an array of zero-padded date parts,
* in UTC
*
* @param {Date} date - Date Object
* @return {[string, string, string, string, string, string, string]}
*/
static getUTCDateParts(date: Date): [string, string, string, string, string, string, string];
}
//# sourceMappingURL=DateFormatter.d.ts.map