Skip to content

Conversation

@ianso
Copy link

@ianso ianso commented Nov 1, 2011

Hi Eric,

First of all, I'm sorry I can't provide a regression test for the bug this patch is supposed to fix. Neither have I built the script and updated the build/ directory - I have looked and I can't find any instructions on which minifier / macros were used and I don't want to bork things up. If you can help with this then I can give you a much better patch with all the builds fixed as well.

This is a one-line fix (despite appearances in the diff) that fixes the (6).months().ago() set of expressions. The reason the fix works is that the add() method in core.js line 308 expects the plural lowercase form of the duration unit to be set, but without the +"s" that I added, sugarpak adds the property as the singular lowercase.

I've made a check of the code and I can't find any other location where the singular is specifically used except in set, so I don't believe that this patch should have any side-effects, for example if the inconsistency between singular and plural is a wider problem in the codebase.

Best regards,

  • Ian

@eric
Copy link
Owner

eric commented Nov 1, 2011

Thanks!

If you want to see it without the whitespace changes, you can actually use:

https://github.com/eric/Datejs/pull/1/files?w=1

As for the build stuff — I actually haven't been using that, but when I started working on this branch, I was trying to change as little as possible, as I wasn't sure if I would hear back from the project owner.

As it doesn't look like that will happen, I may start doing more work to clean up the project, including some of the build stuff.

eric added a commit that referenced this pull request Jan 11, 2012
fix for ago / before functions of datejs
@eric eric merged commit ec45c72 into eric:next Jan 11, 2012
@eric
Copy link
Owner

eric commented Jan 11, 2012

Thanks for the pull request. I've merged this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants