// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(t,e){var n,i,a,r=e.getSpan().allDates().filter(function(n){return/[\d\uff10-\uff19]{1,2}/.test(""+n)&&!t.footer.map(function(t){return e.getSpan().next(t)}).filter(function(t){return t.exists()}).some(function(t){return t.contains(n)})});if(a=r.filter(function(t){return isDateDuration(t)&&!hasTime(t)}),a.length>0)return e.getDetachedSpan(e.getDateDD(a[0]).iso8601).innerDate();var s=r.shift();if(s&&s.exists()&&e.getDateDD(s).endIso8601.length>0&&(s=e.getDetachedSpan(e.getDateDD(s).iso8601).innerDate()),void 0!==t.date)for(i=0;i<t.date.length&&(!n||!n.exists());i++)n=e.getSpan().next(t.date[i]).nextDate(),n.exists()&&/[\d\uff10-\uff19]{1,2}/.test(""+n)&&(s=n);if(void 0!==t.skipDate)for(i=0;i<t.skipDate.length;i+=1)e.getSpan().next(t.skipDate[i]).contains(s)&&(s=s.nextDate());if(s&&s.exists()&&!hasTime(s)){r=e.getSpan().withStart(s.getEnd()).allDates().filter(function(t){return/[\d\uff10-\uff19]{1,2}/.test(""+t)});for(var o=null!==r?r.length:0,D=0;D<o;D++)if(hasTime(r[D])){s=combineDateAndTime(s,r[D]);break}}return s}}).call();