summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/Javascripts/source/prado/datepicker/datepicker.js5
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket849.page5
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket849TestCase.php18
5 files changed, 28 insertions, 2 deletions
diff --git a/.gitattributes b/.gitattributes
index 85c0e434..291182a4 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3077,6 +3077,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket745.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket769.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket785.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket828.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket849.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket93.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket93.php -text
tests/FunctionalTests/tickets/protected/pages/ToggleTest.page -text
diff --git a/HISTORY b/HISTORY
index 692fdb3e..79e5ecec 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,7 @@
Version 3.1.3 To Be Released
============================
BUG: Ticket#836 - TRatingList downgrade (Christophe)
+BUG: Ticket#849 - TDatePicker selecting current date problem (Christophe)
Version 3.1.2 April 21, 2008
============================
diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
index cc5b9c1e..834e89cf 100644
--- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
+++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
@@ -474,7 +474,7 @@ Prado.WebUI.TDatePicker.prototype =
},
onChange : function()
- {
+ {
if(this.options.InputMode == "TextBox")
{
this.control.value = this.formatDate();
@@ -525,10 +525,11 @@ Prado.WebUI.TDatePicker.prototype =
return;
var old=this.selectedDate;
this.selectedDate = this.newDate(date);
+ var dateChanged=(old - this.selectedDate != 0) || ( this.options.InputMode == "TextBox" && this.control.value != this.formatDate());
this.updateHeader();
this.update();
- if (old - this.selectedDate !=0 && typeof(this.onChange) == "function")
+ if (dateChanged && typeof(this.onChange) == "function")
this.onChange(this, date);
},
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket849.page b/tests/FunctionalTests/tickets/protected/pages/Ticket849.page
new file mode 100644
index 00000000..f11b181c
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket849.page
@@ -0,0 +1,5 @@
+<com:TContent ID="Content">
+
+<com:TDatePicker DateFormat="MM-dd-yyyy" />
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php
new file mode 100644
index 00000000..52f47e2e
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket849TestCase.php
@@ -0,0 +1,18 @@
+<?php
+
+class Ticket849TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Ticket849');
+ $this->assertTitle("Verifying Ticket 849");
+ $base='ctl0_Content_';
+ $this->click($base.'ctl0');
+ $this->pause(800);
+ $this->click('css=td.date.today.selected');
+ $this->pause(1000);
+ $this->assertValue($base.'ctl0', date('m-d-Y'));
+ }
+}
+
+?> \ No newline at end of file