1.5.0◀Back | Minified | Changelog | Cautionlog
After a major hiatus, Sugar 2.0.0 is nearly ready to be released. However, v2 introduces many breaking changes, so 1.5.0 is being released in the interim for those who aren't able to upgrade. This will be the last minor release of v1, however support of bugfixes in v1 will continue. Note that the documentation for 1.5.0 will still be available on this site, however other things like custom builds are 2.0.0 only.
Date#getallows date creation with a context date that can be used as a starting point for relative dates.
Function#memoizeallows memoization of expensive functions and is more robust than
- Added ability for
Strip#removeTagsto pass a callback.
- Added a third argument to
Number#bytesto allow normal SI units.
- Added ability to pass a single string to
Date.range, for example
Date.range('monday to thursday').
String#eachto break the loop with
Array#sortByto handle sorting on multiple properties.
String#unescapeHTMLto handle HTML (and hex) codes, as well as
- Set a global thousands and decimal marker with
- Fixed issue with the digit
tenin date creation.
- Fixed issue with the
Date#[unit]Sinceimproperly applying error margins.
- Fixed issue with dates shifting in "monthsFromNow" (and consequently "relative") when traversing into a month that doesn't have enough days.
- Fixed issue with advance/rewind using an object with both a "week" and "day" parameter.
- Fixed issue
Function#everynot being able to cancel itself.
- Fixed issue with German dates not allowing abbreviated weekdays with 2 characters.
- Date.create(null) is now interpeted as a time stamp.
- Fix for ambiguous years not working with
- Fix for odd iOS7 bug with
- Fixed many issues with DST and simplified month traversal.
- Refactored the
fromNowmethods to traverse using internal date methods instead of applying an error margin. This makes them much more accurate during DST traversal, leap years, etc.
Object.sizeto the object package. If you were using custom builds previously be aware of this.