Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2012 Rewrite: v1.1.0pre #10

Merged
merged 1 commit into from
Sep 20, 2012
Merged

Conversation

Krinkle
Copy link
Contributor

@Krinkle Krinkle commented Sep 14, 2012

See commit message

var i, k, minutesOffset,
m = rES5ts.exec(timestamp);
if (m) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could simplify this method my inverting this check, returning NaN, making this a guard clause. Can then remove the indentation on everything below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

New:
* 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

Changes:
* "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 (i18n.nl).
* Bump version number to next +'pre'.

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

Libs:
* curl 'http://code.jquery.com/jquery.js' > libs/jquery.js
* git submodule add git://github.com/jquery/qunit.git libs/jquery.qunit
@jzaefferer jzaefferer merged commit f4d3d0d into jzaefferer:master Sep 20, 2012
@jzaefferer
Copy link
Owner

Landed! Updated the german translation to include the new properties in abbd72b

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.

None yet

2 participants