All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added TypeScript & flow types missing options argument for
add
method - Added overloaded TypeScript declarations allowing for calling
moment.range()
without arguments
- Changed second parameter of
diff
&duration
fromrounded
toprecise
to reflect the underlying moment method - Changed the
moment.range()
&DateRange
constructor
types to allow mixedDate
&Moment
parameters - Changed the
interval
/unit
flow parameter types in theby
,diff
,duration
,reverseBy
&snapTo
to include all strings allowed by moment - Changed internal TypeScript version to
3.3.3333
- Changed internal moment version to
2.24.0
- Changed CircleCI to version
2
- Fixed the return type of
add
andintersect
toDateRange | null
as opposed toDateRange | undefined
- Fixed the flow
toDate()
method return type from an array ofDate
s to aDate
tuple - Fixed
extendMoment()
typescript declaration to give access to moment namespace variables, e.g.moment.duration()
,moment.HTML5_FMT
- Fixed
eslint-plugin-import
pointing to non-existing file
- Deprecated
exclusive
option ofcontains()
method in favour of newexcludeStart
andexcludeEnd
options - Deprecated
exclusive
option ofby()
method in favour of newexcludeEnd
options - Deprecated
exclusive
option ofbyRange()
method in favour of newexcludeEnd
options - Deprecated
exclusive
option ofreverseBy()
method in favour of newexcludeStart
options - Deprecated
exclusive
option ofreverseByRange()
method in favour of newexcludeStart
options - Deprecated
parseZoneRange
in favour ofrangeFromISOString
- Added Typescript definitions
- Added Typescript config and tests
- Added
check
,typescript-test
npm script - Added
excludeStart
andexcludeEnd
tocontains()
method - Added
excludeEnd
toby()
method - Added
excludeEnd
tobyRange()
method - Added
excludeStart
toreverseBy()
method - Added
excludeStart
toreverseByRange()
method - Added note about supporting older browsers with links to polyfills to the README
- Added moment extension
rangeFromISOString
, changed name fromparseZoneRange
- Added
snapTo()
method - Added explicit Flow typing tests
- Changed
build
script to use webpack's production settings for a more optimized build - Changed
prepublish
script toprepublishOnly
so the task isn't run oninstall
- Changed
prepublishOnly
andversion
scripts to use&&
instead of;
- Changed
prepublish
,preversion
,version
scripts to support typescript definitions - Changed CircleCI config to also run typescript tests
- Changed
parseZoneRange
torangeFromISOString
to follow naming conventions. DeprecatedparseZoneRange
. - Changed typing tests to be grouped by type-checker (flow, typescript)
- Changed test suffix (
_test.js
→.test.js
) - Changed test file location (
./lib/
→./lib/tests/
) - Changed package json script names:
flow
→check:flow
typescript-test
→check:typescript
- Changed CircleCI to use Node 8.2.0
- Changed CircleCI to use Yarn
- Changed Flow config to find correct declarations
- Changed location of Flow declaration (
./declarations/
→./lib/
)
- Fixed
intersect
not creating a new DateRange instance in all cases - Fixed Flow declaration to provide correct and stricter typings
- Fixed DateRange constructor poor performance when passed moment objects
- Removed
lib/
from package.json files - Removed a bunch of unused Flow types
- Fixed intersection rules for zero-length ranges on start/end boundaries
- Added function
isRange
as a simple and clear way to check if a variable is a DateRange - Added moment extension
parseZoneRange
to preserve timezone of start/end dates in a new range - Added moment extension
rangeFromInterval
to create a range between a date and a specified interval
- Changed open-ended ranges to accept any falsy value (except 0)
- Changed
add
function: now has an option for adding adjacent ranges - Changed README: tidied documentation examples
- Fixed typo in README in method
add
- Fixed webpack output path for webpack >2.3.0
- Fixed linter errors/warnings for development
- Fixed repository URLs in CHANGELOG
- 'module' has been replaced with 'jsnext:main' to support both rollup and webpack 2
lib
is now included in npm release to allow packagers to repackage the library- Update to webpack 2
- Add @victoriafrench to CONTRIBUTORS
- Add @JochenDiekenbrock to CONTRIBUTORS
- Added contributors to README
- Added CircleCI badge to README
- Added yarn lockfile
- Added polyfill for
Symbol
- Updated contributors in package.json
- Updated usage instructions for browsers (
window['moment-range']
) - Moved
expect.js
from dependencies to development dependencies
- ES6
- Flow typing
- Added documentation about range creation (thanks @seanwendt)
- Added webpack
- Added eslint
- Added karma/mocha/expect.js
- Added many more tests
- Addded new methods:
by
,reverseBy
,byRange
,reverseByRange
(#68)- Pass options as object
- New methods use iterators
- Added reversal methods
- Discrete methods for different iterator types
- Added ability to iterate over a range by a step (#93)
- Added
isEqual
as alias ofisSame
- Added
adjacent
method and option tooverlaps
(#92 #112) - Added
duration
as an alias ofdiff
(#64) - Added CircleCI config
- Documentation
- Changed usage: import Moment from 'moment'; import { DateRange, extendMoment } from 'moment-js'; const moment = extendMoment(Moment);
- Pass additonal optional rounded argument in
diff
(#104) - Updated short-hand units (#134)
- Updated packaging rules and scripts
- Iteration methods now return an
Iterator
dist/
is only included in the npm release now
- Removed bower
- Removed grunt
- Removed jshint
- Removed mocha/should
- Removed
toArray
- Fixed issue with
moment#within
and moment-timezone (#127) - Fixed typo in comment (#133)