X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..41497a896330304904ef6d5783c724ea713739f6:/wp-admin/js/comment.dev.js diff --git a/wp-admin/js/comment.dev.js b/wp-admin/js/comment.dev.js index 1f15b5be..a014a515 100644 --- a/wp-admin/js/comment.dev.js +++ b/wp-admin/js/comment.dev.js @@ -22,16 +22,26 @@ jQuery(document).ready( function($) { }); $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels + var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(), + newD = new Date( aa, mm - 1, jj, hh, mn ); + + if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) { + $('.timestamp-wrap', '#timestampdiv').addClass('form-invalid'); + return false; + } else { + $('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid'); + } + $('#timestampdiv').slideUp("normal"); $('.edit-timestamp').show(); $('#timestamp').html( commentL10n.submittedOn + ' ' + - $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + - $('#jj').val() + ', ' + - $('#aa').val() + ' @ ' + - $('#hh').val() + ':' + - $('#mn').val() + ' ' + $( '#mm option[value="' + mm + '"]' ).text() + ' ' + + jj + ', ' + + aa + ' @ ' + + hh + ':' + + mn + ' ' ); return false; }); -}); \ No newline at end of file +});