Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Add fromNow boolean option, to display relative dates #1

Merged
merged 1 commit into from
Jul 28, 2015

Conversation

cillianderoiste
Copy link
Contributor

outputFormat will be ignored if fromNow is true.
e.g. data-pat-display-time="fromNow: true"

outputFormat will be ignored if fromNow is true.
e.g. data-pat-display-time="fromNow: true"
@adrianwhite
Copy link
Member

Hi @cillianderoiste , this will operate as expected but what is the premise behind doing this?

@adrianwhite
Copy link
Member

Sorry, I did not read the commit thoroughly enough.

adrianwhite pushed a commit that referenced this pull request Jul 28, 2015
Add fromNow boolean option, to display relative dates
@adrianwhite adrianwhite merged commit f8873a5 into master Jul 28, 2015
@jcbrand
Copy link
Contributor

jcbrand commented Jul 28, 2015

The patterns convention is that arguments are hyphen separated.

So the arguments should actually be: from-now, output-format and output-locale.

@cillianderoiste I know that you were just following the convention in this pattern, but maybe you could nip this in the bud and correct the argument names?

@jcbrand
Copy link
Contributor

jcbrand commented Jul 28, 2015

@cillianderoiste You can use the parser.addAlias method to add aliases to outputFormat and outputLocale, so that old declarative configurations of the pattern still work.

If you do a grep for addAlias in Patternslib you'll find an example where it's used.

@adrianwhite
Copy link
Member

@jcbrand @cillianderoiste sorry about my premature merge of this.
Thanks for the pointers @jcbrand

@cillianderoiste
Copy link
Contributor Author

@adrianwhite @jcbrand I guess there's no need to be backwards compatible here, and we can just use the hyphen separated version. Shall I take care of it @adrianwhite, or have you already got it?

@adrianwhite
Copy link
Member

@cillianderoiste I'm a bit snowed under by client work at the mo.
If you could do this it would be most useful. Cheers.

@cillianderoiste
Copy link
Contributor Author

Sure, no problemo.

@adrianwhite adrianwhite deleted the fromNow branch March 11, 2016 10:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants