Commit 45773046 authored by KR Moorhouse's avatar KR Moorhouse Committed by GitHub

Merge pull request #3547 from wpninjas/fix-date-again

fixed date formatting again
parents 34db3e2d 706df0ee
......@@ -22,6 +22,11 @@ define([], function() {
var fieldID = model.get( 'id' );
var value = model.get( 'value' );
var format = model.get( 'date_format' );
if( 'default' === format) {
format = nfi18n.dateFormat;
}
if ( 0 < value.length ) {
// use moment's isValid to check against the fields format setting
if( moment( value, format ).isValid() ) {
......@@ -68,7 +73,11 @@ define([], function() {
/*
* Get our current date format
*/
var format = model.get( 'format' );
var format = model.get( 'date_format' );
if( 'default' === format) {
format = nfi18n.dateFormat;
}
/*
* Check our value to see if it is a valid email.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment