Post settings published_at date improvements & fixes

closes #1866, fixes #2067, fixes #2068

- Upgrade client side moment to 2.4.0 to match the server side script.
- Add a guard to pub date to fix #2067
- Add new format to close #1866
This commit is contained in:
Hannah Wolfe 2014-01-29 21:41:19 +00:00
parent 1afeeaf2d4
commit 47c5e5aca4
2 changed files with 838 additions and 185 deletions

View File

@ -5,8 +5,8 @@
(function () {
"use strict";
var parseDateFormats = ['DD MMM YY HH:mm', 'DD MMM YYYY HH:mm', 'DD/MM/YY HH:mm', 'DD/MM/YYYY HH:mm',
'DD-MM-YY HH:mm', 'DD-MM-YYYY HH:mm'],
var parseDateFormats = ["DD MMM YY HH:mm", "DD MMM YYYY HH:mm", "DD/MM/YY HH:mm", "DD/MM/YYYY HH:mm",
"DD-MM-YY HH:mm", "DD-MM-YYYY HH:mm", "YYYY-MM-DD HH:mm"],
displayDateFormat = 'DD MMM YY @ HH:mm';
Ghost.View.PostSettings = Ghost.View.extend({
@ -158,7 +158,8 @@
e.preventDefault();
var self = this,
errMessage = '',
pubDate = moment(self.model.get('published_at')).format(displayDateFormat),
pubDate = self.model.get('published_at') ? moment(self.model.get('published_at'))
.format(displayDateFormat) : '',
pubDateEl = e.currentTarget,
newPubDate = pubDateEl.value,
pubDateMoment,

File diff suppressed because it is too large Load Diff