Sugar
Sugar copied to clipboard
A Javascript library for working with native objects.
Handling two digit dates is ambiguous. There looks like some current heuristics around how to handle this, but it would be good to allow it to be configurable so applications...
Hi, in Italian dates, one may reference "next Monday" as "_lunedì prossimo_" (where "_prossimo_" is the translation of "_next_"), but, using the Italian locale: - "lunedì prossimo" is parsed as...
With Sugar.Date, I can create specific `datetime`s through human readable strings. For example `Sugar.Date.create('today')` sets it to _today_ at _12:00AM_ For some use cases, such as sayusing it to set...
It seems the popular german date format of {dd}.{mm}.{yy} causing inconsistent results. Validated with Chrome on the Sugar.js date demo homepage in the console. Replicate by typing this into the...
Is there a good way to get the month names of the current locale? I´ve been using this in version 2.0.0: ```coffeescript CalendarDefaults.monthNames = (m.capitalize() for m in Date.getLocale().months[0...12]) ```...
I just encountered a situation where it would be nice to say `new Date.range("since the first of the quarter")`. .. and since we have "the first of the year" and...
I am trying to parse when the date reads 26m ago or 22h ago. I assumed `Date.getLocale('en').addFormat('(\\d+)m {sign}', ['minutes']);` would work. However, I am without luck. Is there a way...
Greetings! I can't find any info in official [(docs)](https://sugarjs.com/docs/#/Array/sortBy) for sorting multidimensional arrays by multiple items with choosing sorting direction. So, i wrote this function: ` window.sortByMultiple = function(arr, field1,...
The title says it all. Here's an example on how to reproduce it: require('sugar').Date.create().format() For now as a work around I'm wrapping create calls with Date: ``` const { Date...
Currently `require('sugar').Date().valueOf()` returns an object rather a number like javascript `new Date().valueOf()` or even `require('sugar').Date.create().valueOf()`. This breaks where you can do stuff like `date1 < date2` with javascript dates but...