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 two new date methods —
apmonthtab
andapdatetab
. These two are identical toapmonth
andapdate
except months are output in AP's tabular format instead. Instead ofSept.
you getSep
, etc. - The logic for determining the correct suffix in
ordinal
has been extracted and made into its own method calledordinalsuffix
. This makes it possible to access the correct suffix for a number without modifying the original value. Great for if you'd like to style the number and suffix differently, or just want to output them separately. Credit to @sawyerclick for the suggestion in #283!
- Due to how Node module resolution works with ECMAScript modules, the
module
andexports.import
files must have.mjs
extensions.
- Add export map to
package.json
.
intword
now supports negative integers.intcomma
now has tests confirming it does support negative numbers, but no changes were made to the code.
- Bumped LICENSE to 2020.
ordinal
now accepts a second boolean parameter (that defaults tofalse
) that outputs 1 through 9 as spelled out (first, third, seventh, etc.) instead of as numeral ordinals, per AP style rules.
- Added missing
types
directory to thepackage.json
files
list.
- Added TypeScript type file.
- Explicitly convert supplied values to strings with
toString()
in functions that short circuit to guarantee it returns the correct type.
- Updated LICENSE year to 2019
- Updated dependencies
- General housekeeping of the repo
- Add Node 11 to test matrix
- Moved tests to
__tests__
directory so we stop shipping them in the npm bundle
- Fixed bug with
pluralize
where an Array with a single number in it that's not1
is considered plural due toparseFloat
andNumber
being weird when passed an Array.
- Added
unpkg
andjsdelivr
fields to package.json - Added
widont
function
- Removed
umd:main
field from package.json
- Fixed bug in
aptime
where it would return0
for times at 12 p.m. when there were also minutes (thanks @jmuyskens)
- Added
aptime
function - Added
capfirst
function - Added
pluralize
function - Added
yesno
function
- Removed
date-fns
dependency, which means date/time based functions (apdate
,apmonth
,aptime
) no longer can parse ISO date strings (or anything else someone may have thrown at it thatdate-fns/parse
could have handled)
- Removed
lodash
dependency - Removed
apstate
andpostal
functions, they were slightly too specific and out of scope and probably should exist as their own libraries
- Added
postal
function
- Added
apstate
function
- The beginning of time 🎉
- Added
apnumber
,intcomma
,intword
andordinal
functions