@paycar-cli/transfer-eta-module
v3.2.3
Published
## setUp node >= 12.1.0
Downloads
17
Readme
Wire transfer timeline simulator
setUp
node >= 12.1.0
/!\ lib use es6 import /!\
install
npm i
run example
npm run example
or node --experimental-modules --experimental-json-modules example/node-esm-example.js
build to browser
npm run build
browser
<script src="dist/main.d2d647ef096f9410f236.js"><script>
example with a transfert eta in express mode
import { transferEta } from '@paycar-cli/wire-transfer-timeline-simulator/src/index.js'
const result = transferEta('15/04/2019 8:00:00', true, 'fr')
result :
{
isExpress: true,
transferCreationDateString: '15/04/2019 8:00:00',
transferCreatedAt: 2019-04-15T08:00:00.001Z,
transferExecutedAt: {
date: 2019-04-15T08:00:00.001Z
},
transferEarliestEta: {
date: 2019-04-15T20:00:00.001Z
}
}
example with a transfert eta
import { transferEta } from '@paycar-cli/wire-transfer-timeline-simulator/src/index.js'
const result = transferEta('18/04/2019 8:00:00', false, 'fr')
result :
{
isExpress: false,
transferCreationDateString: '18/04/2019 8:00:00',
transferCreatedAt: 2019-04-18T08:00:00.001Z,
transferExecutedAt: {
date: 2019-04-18T08:00:00.001Z,
daysOff: { weekend: [], holidays: [] }
},
transferEarliestEta: {
date: 2019-04-23T08:00:00.001Z,
daysOff: {
weekend: [
2019-04-20T08:00:00.001Z,
2019-04-21T08:00:00.001Z
],
holidays: [
2019-04-19T08:00:00.001Z,
2019-04-22T08:00:00.001Z
]
}
},
transferLatestEta: {
date: 2019-04-24T08:00:00.001Z,
daysOff: {
weekend: [
2019-04-20T08:00:00.001Z,
2019-04-21T08:00:00.001Z
],
holidays: [
2019-04-19T08:00:00.001Z,
2019-04-22T08:00:00.001Z
]
}
}
}
[new] method transfer eta request date
import { transferRequestDate } from './../../src/index.js'
import { TransactionMustBeInFuture } from "../../src/helpers/error/transaction-must-be-in-future.js";
import {TransactionDateIsTooShort} from "../../src/helpers/error/transaction-date-is-too-short.js";
const dateBankHolidaysWorks = '7/07/2019 8:00:00'
let result
try {
result = transferRequestDate(dateBankHolidaysWorks, 'fr')
} catch (e) {
console.log(e)
}