Closed mintsoft closed 10 years ago
As an aside, this is another place where a role or shared library may make sense. I know that "WorkdaysBetween" handles a variety of different date formats (and even tries to disambiguate MM/DD/YYYY from DD/MM/YYYY).
If developers had an opportunity to use the "DDH standard" for recognizing, parsing and displaying different date formats, they would surely jump on it. That would also make things better for users who would be more likely to trigger the relevant IA.
@mwmiller Agreed!
ditto, fwiw if there's any particular helper functions you guys think should be available to all goodies/spice without the need to explicitly use
a package, they can always be added into Helper.pm: https://github.com/duckduckgo/duckduckgo/blob/master/lib/DDG/Meta/Helper.pm
Maybe I can look at it since I've worked on DaysBetween's bug.
REF: https://github.com/duckduckgo/zeroclickinfo-goodies/pull/514
Agree with the shared libraries! Since we have something like that on the JS side (DDG.capitalize
, DDG.isRelevant
, etc.) it makes sense to have something for Perl, too.
Like days between 2010-09-17 2014-06-26 ! I believe it only accepts US date format currently (MM/DD/YYYY) I'm not going to suggest trying to deal with DD/MM/YYYY as well, but at least an unambiguous format should work imo! :)