don't wrap null dates in moments
fixes CNVS-25102 test-plan: - go to create a new appointment group - enter just the date; should not get an error about start needing to be before end - enter just the date and start (no end); same - enter just the date and end (no start); same - enter a date and start and end, with start before end; no error - enter a date and start and end, with start after end; should get the error Change-Id: I8ab3fddeef5d765f15c75e7f489201ea03e07714 Reviewed-on: https://gerrit.instructure.com/67325 Tested-by: Jenkins Reviewed-by: Mike Nomitch <mnomitch@instructure.com> QA-Review: Gentry Beckmann <gbeckmann@instructure.com> Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
This commit is contained in:
parent
62847b535b
commit
eb3f0661a4
|
@ -8,6 +8,7 @@ define [
|
||||||
# expects a date (unfudged), and returns a fullcalendar moment
|
# expects a date (unfudged), and returns a fullcalendar moment
|
||||||
# (fudged) appropriate for passing to fullcalendar methods
|
# (fudged) appropriate for passing to fullcalendar methods
|
||||||
wrap = (date) ->
|
wrap = (date) ->
|
||||||
|
return null unless date
|
||||||
$.fullCalendar.moment($.fudgeDateForProfileTimezone(date))
|
$.fullCalendar.moment($.fudgeDateForProfileTimezone(date))
|
||||||
|
|
||||||
# expects a fullcalendar moment (fudged) from a fullcalendar
|
# expects a fullcalendar moment (fudged) from a fullcalendar
|
||||||
|
|
|
@ -92,6 +92,10 @@ define [
|
||||||
me = new TimeBlockRow(@timeBlockList)
|
me = new TimeBlockRow(@timeBlockList)
|
||||||
ok me.validate()
|
ok me.validate()
|
||||||
|
|
||||||
|
test 'valid if incomplete', ->
|
||||||
|
me = new TimeBlockRow(@timeBlockList, start: @start, end: null)
|
||||||
|
ok me.validate()
|
||||||
|
|
||||||
test 'getData', ->
|
test 'getData', ->
|
||||||
me = new TimeBlockRow(@timeBlockList, {@start, @end})
|
me = new TimeBlockRow(@timeBlockList, {@start, @end})
|
||||||
me.validate()
|
me.validate()
|
||||||
|
|
Loading…
Reference in New Issue