@cosmjs/encoding
Advanced tools
Comparing version 0.24.0-alpha.24 to 0.24.0-alpha.25
import { ReadonlyDate } from "readonly-date"; | ||
export declare function fromRfc3339(str: string): ReadonlyDate; | ||
export declare function fromRfc3339(str: string): Date; | ||
export declare function toRfc3339(date: Date | ReadonlyDate): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toRfc3339 = exports.fromRfc3339 = void 0; | ||
const readonly_date_1 = require("readonly-date"); | ||
const rfc3339Matcher = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/; | ||
@@ -38,3 +37,4 @@ function padded(integer, length = 2) { | ||
const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60; // seconds | ||
return new readonly_date_1.ReadonlyDate(readonly_date_1.ReadonlyDate.UTC(year, month - 1, day, hour, minute, second, milliSeconds) - tzOffset * 1000); | ||
const timestamp = Date.UTC(year, month - 1, day, hour, minute, second, milliSeconds) - tzOffset * 1000; | ||
return new Date(timestamp); | ||
} | ||
@@ -41,0 +41,0 @@ exports.fromRfc3339 = fromRfc3339; |
{ | ||
"name": "@cosmjs/encoding", | ||
"version": "0.24.0-alpha.24", | ||
"version": "0.24.0-alpha.25", | ||
"description": "Encoding helpers for blockchain projects", | ||
@@ -50,3 +50,3 @@ "contributors": [ | ||
}, | ||
"gitHead": "15a3a9b83a2cfe3deae389128ede5e58e3041569" | ||
"gitHead": "8e4813405c182d3d0f5625a88f8a3ea9d09347cd" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32169