Skip to content

Commit

Permalink
Make sure we check both date fields when clicking Save.
Browse files Browse the repository at this point in the history
It's possible to delete out the field and click save without the
onChange event firing on some browsers.
  • Loading branch information
mrubinsk committed May 7, 2016
1 parent 5738ec3 commit 4a91704
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kronolith/js/kronolith.js
Original file line number Diff line number Diff line change
Expand Up @@ -4569,6 +4569,8 @@ KronolithCore = {

case 'kronolithEventSave':
if (!elt.disabled) {
this._checkDate($('kronolithEventStartDate'));
this._checkDate($('kronolithEventEndDate'));
if ($F('kronolithEventAttendees') && $F('kronolithEventId')
&& (!$F('kronolithEventOrganizer') || this.attendanceChanged) &&
!Kronolith.conf.itip_silent) {
Expand Down Expand Up @@ -6936,7 +6938,11 @@ KronolithCore = {
},

checkDate: function(e) {
var elm = e.element();
this._checkDate(e.element());
},

_checkDate: function(elm)
{
if ($F(elm)) {
var date = Date.parseExact($F(elm), Kronolith.conf.date_format) || Date.parse($F(elm));
if (date) {
Expand Down

0 comments on commit 4a91704

Please sign in to comment.