Added allowPast settings & tests #169

Merged
merged 3 commits into from Mar 3, 2014

Projects

None yet

2 participants

@richhildebrand

Added a setting for allowPast that when set to "false" prevents timeago from showing times that are in the past, and instead displays a static message defined in settings.strings.inPast. This was useful for a case where we had a count-down timer on a screen that used allowFuture=true but we did not want the displayed message to go to an "X minutes ago" message after the timer had reached 0. allowPast defaults to "true" which retains the existing behavior, and either allowPast and/or allowFuture must be set to "true". An error is thrown if they are both set to "false".

Rich Hildebrand added some commits Feb 25, 2014
Rich Hildebrand Added a test for allowFuture = false
No change to existing functionality. Just testing existing behavior.
873f0f7
Rich Hildebrand Added "allowPast" setting. 9d6c2c6
Rich Hildebrand Added docs for "allowPast" setting. d0e161a
@rmm5t rmm5t merged commit fc90536 into rmm5t:master Mar 3, 2014
@rmm5t
Owner
rmm5t commented Mar 3, 2014

Thanks. This pull-request was nicely put together. Tests always make them easier to pull in. 🍻

@rmm5t
Owner
rmm5t commented Mar 3, 2014

This is now part of a newly released v1.4.0

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