Releases: flowxo/flowxo-utils
Releases · flowxo/flowxo-utils
v3.0.0
Added
- Timezone support for
Utils.parseDateTimeField()
- Locale support for
Utils.parseDateTimeField()
Utils.parseDateTimeField(date [, Object])
takes a second optional parameter of object.
timezone
defaults toUTC
locale
defaults toen
Usage:
Utils.parseDateTimeField('today at 3pm', {
timezone: 'Europe/London',
locale: 'en-GB'
});
Breaking change
Upgraded Sugar Date module from 1.x to 2.x. See Sugar breaking changes
Date
object no longer gets extended with SugarDate by default. If you want to extend the Date
object you must call Utils.activateDateParser()
.
v2.0.0
Added
maxDuration
option to backoff module, to support abortion of backoff if the total operation time has or will exceed themaxDuration
parameter on the next retry.
Breaking change
Backoff module is now invoked differently. Instead of creating a new Backoff
object, and passing in the minDelay
and maxDelay
, you now pass everything into the attempt
or attemptAsync
methods.
Assuming the following operation:
var operation = function() {
return new Promise(function (resolve, reject) {
request(options, function(err, res, body) {
if(err) {
return reject(err);
}
resolve(body);
}
});
Old (1.x) syntax:
var backoff = new Backoff(100, 1000);
backoff.attemptAsync(5, operation).then(res => {
// Do something with result
}, err => {
// Do something with error
})
New (2.0) syntax:
var options = {
minDelay: 100,
maxDelay: 1000,
maxAttempts: 5
};
backoff.attemptAsync(operation, options).then(res => {
// Do something with result
}, err => {
// Do something with error
})