diff --git a/CHANGELOG.md b/CHANGELOG.md index c74dbfdb..8bd38365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ ## Unreleased +## [1.13.0] - 2019-08-13 + +### Chore + +- [BREAKING CHANGE] Migrating from `moment` to `date-and-time`. + - Thanks to [Marcin Krysiak](https://github.com/marcinkrysiak1979) for contributing! + +### Fix + +- [#184](https://github.com/benhurott/react-native-masked-text/issues/184) TextInputMask doesnt render mask correctly when type change. + - Thanks to [Rodrigo Weber](https://github.com/RodrigoAWeber) for contributing! + +### Docs + +- Fixing documentaion link. + - Thanks to [Luan Curti](https://github.com/luancurti) for contributing! + ## [1.12.5] - 2019-08-03 ### Fix diff --git a/README.md b/README.md index b5714a64..2e57a2da 100644 --- a/README.md +++ b/README.md @@ -535,7 +535,7 @@ console.log(numberValue) // Number Mask: `accept only numbers` -Sample code ([source](https://github.com/benhurott/react-native-masked-text-samples/blob/master/ReactNativeMaskedTextSamples/Samples/ZipCode.js)): +Sample code ([source](https://github.com/benhurott/react-native-masked-text-samples/blob/master/ReactNativeMaskedTextSamples/Samples/OnlyNumbers.js)): ```jsx diff --git a/__tests__/mask/datetime.mask.test.js b/__tests__/mask/datetime.mask.test.js index c064ec0c..22ba166b 100644 --- a/__tests__/mask/datetime.mask.test.js +++ b/__tests__/mask/datetime.mask.test.js @@ -1,9 +1,9 @@ import { DatetimeMask } from '../../lib/masks' -var moment = require('moment') +import date from 'date-and-time'; function compareMomentObj(dateTimeA, dateTimeB) { - var momentA = moment(dateTimeA, 'DD/MM/YYYY') - var momentB = moment(dateTimeB, 'DD/MM/YYYY') + var momentA = new Date(dateTimeA) + var momentB = new Date(dateTimeB) if (momentA > momentB) return 1 else if (momentA < momentB) return -1 else return 0 @@ -94,7 +94,7 @@ test('01011990174030 with format DD/MM/YYYY HH:mm:ss results 01/01/1990 17:40:30 var expected = '01/01/1990 17:40:30' var received = mask.getValue('01011990174030') - var expectedRawValue = moment(received, 'DD/MM/YYYY HH:mm:ss', true) + var expectedRawValue = date.parse(received, 'DD/MM/YYYY HH:mm:ss') var receivedRawValue = mask.getRawValue(received) expect(received).toBe(expected) diff --git a/dist/lib/masks/datetime.mask.js b/dist/lib/masks/datetime.mask.js index a3e9eedc..eed58f93 100644 --- a/dist/lib/masks/datetime.mask.js +++ b/dist/lib/masks/datetime.mask.js @@ -1 +1 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i