mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
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:
parent
1afeeaf2d4
commit
47c5e5aca4
@ -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,
|
||||
|
1016
core/shared/vendor/moment.js
vendored
1016
core/shared/vendor/moment.js
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user