Adding support for months and years #8

wants to merge 2 commits into


None yet

3 participants

fitorec commented Jul 16, 2012

I also added a location file into Spanish example(I'm Mexican).

@fitorec fitorec Adding support for months and years
I also added a location file into Spanish example(I'm Mexican).
fitorec commented Jul 16, 2012

By the way when revice localization files I realized that there are 2 files that change the format in the name:

├── jquery-prettydate-fr.js
└── jquery-prettydate-lv.js

It may be an idea to rename the same way as the others:

#Replacing the character '-' to '.'
git mv localization/jquery-prettydate-fr.js localization/jquery.prettydate-fr.js
git mv localization/jquery-prettydate-lv.js localization/jquery.prettydate-lv.js
@Krinkle Krinkle commented on an outdated diff Sep 14, 2012
@@ -89,7 +91,9 @@ $.prettyDate.messages = {
hours: $.prettyDate.template("{0} hours ago"),
yesterday: "Yesterday",
days: $.prettyDate.template("{0} days ago"),
- weeks: $.prettyDate.template("{0} weeks ago")
+ weeks: $.prettyDate.template("{0} weeks ago"),
+ months: $.prettyDate.template("{0} mounths ago"),
@fitorec fitorec Checking my error.
 Reviewing the singular and plural of weeks and months.
fitorec commented Sep 17, 2012


I just made the appropriate changes😉.

@jzaefferer jzaefferer pushed a commit that closed this pull request Sep 20, 2012
@Krinkle Krinkle 2012 Rewrite: v1.1.0pre
* New parser, made as public API ($.prettyDate.parse).
* Timezones fully supported as supported by ES5 Date.parse and
  ISO 8601.
* Recognition of (+ unit tests)
 - 1 week
 - 1 month
 - # months
 - 1 year
 - # years
   I've taken months and years with a low-end margin (since days
   in a month/year varies). Also use a 2-week buffer between
   the date and the 1+ next year. So if something is 1 year and 2
   weeks ago, it shows 1 year not 2 years already.
* Documentation blocks.
* /demo: Add all variations (same as /test).
* /demo: Add dynamic language switcher menu

* "isUTC" option no longer needed. ISO 8601 timestamps can
  contain timestamps themselves (and should!). Previously this
  was relevant because the lazy parsing implementation removed
  [TZ] from the string. But now that this is taken into
  consideration, it will be more accurate.
  I considered keeping it, but couldn't make it work reliably.
  It has to be in the timestamp itself for it to be relevant.
* Removed .fromUTC().
* Converted line endings to Unix (git-diff ^M warnings).
* Rename /localization and files to match jquery-ui convention.
  New directory: /i18n
  The filenames were mostly already there, renamed:
 - 'jquery-prettydate-fr.js'
 - 'jquery-prettydate-lv.js'
* Added new lines at EOFs.
* Update upstream libs.
* Update demo markup.
* Update unit tests.
* Update Dutch translation (
* Bump version number to next +'pre'.

* Fix indentation and missing semicolons in various places
* Fix "same has been deprecated since 2009 (e88049a0), use
   assert.deepEqual instead".
* Passed JSHint.
* Closes #2: Bad results when server and client timezones differ.
* Closes #6: "1 weeks" -> "1 week".
* Closes #8: Adding support for months and years.

* curl '' > libs/jquery.js
* git submodule add git:// libs/jquery.qunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment