sling-web-helpers
Advanced tools
Comparing version 0.2.31 to 0.2.32
@@ -7,2 +7,3 @@ 'use strict'; | ||
var defaultSdkCallDateFormat = exports.defaultSdkCallDateFormat = 'YYYY-MM-DD'; | ||
var dateTimeDigitFormat = '2-digit'; | ||
var locale = 'pt-BR'; | ||
@@ -17,3 +18,18 @@ | ||
var formtatCurrencyWithoutSymbol = exports.formtatCurrencyWithoutSymbol = function formtatCurrencyWithoutSymbol(value) { | ||
return value.toLocaleString(locale, { minimumFractionDigits: 2 }); | ||
return value.toLocaleString(locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); | ||
}; | ||
var formatDate = exports.formatDate = function formatDate(item) { | ||
return new Date(item).toLocaleDateString(locale); | ||
}; | ||
var formatTime = exports.formatTime = function formatTime(item) { | ||
return new Date(item).toLocaleTimeString(locale, { | ||
hour: dateTimeDigitFormat, minute: dateTimeDigitFormat | ||
}); | ||
}; | ||
var setPaginateRequestRange = exports.setPaginateRequestRange = function setPaginateRequestRange(pageEvent, occurrenciesPerPage) { | ||
var rangeEnd = pageEvent.detail.index * occurrenciesPerPage - 1; | ||
var rangeInit = rangeEnd - (occurrenciesPerPage - 1); | ||
return rangeInit + '-' + rangeEnd; | ||
}; |
export const defaultSdkCallDateFormat = 'YYYY-MM-DD'; | ||
const dateTimeDigitFormat = '2-digit'; | ||
const locale = 'pt-BR'; | ||
@@ -8,2 +9,13 @@ | ||
export const formtatCurrencyWithoutSymbol = value => value.toLocaleString(locale, { minimumFractionDigits: 2 }); | ||
export const formtatCurrencyWithoutSymbol = value => value.toLocaleString(locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); | ||
export const formatDate = item => new Date(item).toLocaleDateString(locale); | ||
export const formatTime = item => new Date(item).toLocaleTimeString(locale, { | ||
hour: dateTimeDigitFormat, minute: dateTimeDigitFormat | ||
}); | ||
export const setPaginateRequestRange = (pageEvent, occurrenciesPerPage) => { | ||
const rangeEnd = pageEvent.detail.index * occurrenciesPerPage - 1; | ||
const rangeInit = rangeEnd - (occurrenciesPerPage - 1); | ||
return `${rangeInit}-${rangeEnd}`; | ||
}; |
{ | ||
"name": "sling-web-helpers", | ||
"version": "0.2.31", | ||
"version": "0.2.32", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
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
7436
158