zalopay-formatters
Advanced tools
Comparing version 3.0.2 to 3.0.3
declare function stringWithTimesamp(timestamp: number, format?: string): string; | ||
declare function stringFromTimeStamp(timestamp: number, format: string): string; | ||
declare function convertFormat(dateString: string, fromFormat: string, toFormat: string): string; | ||
declare const _default: { | ||
stringWithTimesamp: typeof stringWithTimesamp; | ||
stringFromTimeStamp: typeof stringFromTimeStamp; | ||
convertFormat: typeof convertFormat; | ||
}; | ||
export default _default; |
@@ -7,6 +7,9 @@ "use strict"; | ||
const moment_1 = __importDefault(require("moment")); | ||
function stringWithTimesamp(timestamp, format = "DD/MM/YYYY - HH:mm") { | ||
const time = moment_1.default(timestamp, "x").utcOffset("+07:00"); | ||
function stringWithTimesamp(timestamp, format = 'DD/MM/YYYY - HH:mm') { | ||
const time = moment_1.default(timestamp, 'x').utcOffset('+07:00'); | ||
return time.format(format); | ||
} | ||
function stringFromTimeStamp(timestamp, format) { | ||
return stringWithTimesamp(timestamp, format); | ||
} | ||
function convertFormat(dateString, fromFormat, toFormat) { | ||
@@ -17,3 +20,4 @@ return moment_1.default(dateString, fromFormat).format(toFormat); | ||
stringWithTimesamp, | ||
convertFormat | ||
stringFromTimeStamp, | ||
convertFormat, | ||
}; |
@@ -14,2 +14,3 @@ import ZPFormat from "./format"; | ||
stringWithTimesamp: (timestamp: number, format?: string) => string; | ||
stringFromTimeStamp: (timestamp: number, format: string) => string; | ||
convertFormat: (dateString: string, fromFormat: string, toFormat: string) => string; | ||
@@ -16,0 +17,0 @@ }; |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TimeFormatter = exports.NumberFormatter = exports.ZPDate = exports.ZPTelco = exports.ZPFormat = void 0; | ||
const format_1 = __importDefault(require("./format")); | ||
@@ -8,0 +9,0 @@ exports.ZPFormat = format_1.default; |
{ | ||
"name": "zalopay-formatters", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Provide basic functions process number, text", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,11 +0,18 @@ | ||
import moment from "moment"; | ||
import moment from 'moment'; | ||
function stringWithTimesamp( | ||
timestamp: number, | ||
format: string = "DD/MM/YYYY - HH:mm" | ||
format: string = 'DD/MM/YYYY - HH:mm' | ||
) { | ||
const time = moment(timestamp, "x").utcOffset("+07:00"); | ||
const time = moment(timestamp, 'x').utcOffset('+07:00'); | ||
return time.format(format); | ||
} | ||
function stringFromTimeStamp( | ||
timestamp: number, | ||
format: string, | ||
) { | ||
return stringWithTimesamp(timestamp, format); | ||
} | ||
function convertFormat( | ||
@@ -21,3 +28,4 @@ dateString: string, | ||
stringWithTimesamp, | ||
convertFormat | ||
stringFromTimeStamp, | ||
convertFormat, | ||
}; |
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
32913
1136