Skip to content

Commit

Permalink
Added logic to set selection_mode to true when default_time is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
shihgianlee committed Mar 15, 2010
1 parent 028d941 commit b55f6fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js_test/functional/cds_test.html
Expand Up @@ -221,15 +221,15 @@
cds = new CalendarDateSelect($("cds_test"), {default_time:function() { return new Date('January 02, 2008 2:00 PM') }});
assertEqual('2008', cds.selected_date.getFullYear());
assertEqual('2008', cds.date.getFullYear());
assert(! cds.selection_made)
assert(cds.selection_made)
cds.close();
}},
test_parseDate_defaultTime_javaScriptDatePassed_shouldReturnJavaScriptDate: function() {with(this){
$("cds_test").value = " ";
cds = new CalendarDateSelect($("cds_test"), {default_time:new Date('January 02, 2007 05:45 PM') });
assertEqual('2007', cds.selected_date.getFullYear());
assertEqual('2007', cds.date.getFullYear());
assert(! cds.selection_made)
assert(cds.selection_made)
cds.close();
}},
test_passDivElement__shouldUseChildInputForTargetElement: function() {with(this){
Expand Down
Expand Up @@ -334,7 +334,7 @@ CalendarDateSelect.prototype = {
{
var value = $F(this.target_element).strip()
var default_time = this.options.get("default_time");
this.selection_made = (value != "");
this.selection_made = (value != "" || default_time);
this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value);
if (isNaN(this.date) && !default_time)
this.date = new Date();
Expand Down

0 comments on commit b55f6fa

Please sign in to comment.