From 2c96e6fec5de32b13bc840d76a6e92c3d27f2c0d Mon Sep 17 00:00:00 2001 From: tof <> Date: Wed, 7 May 2008 16:27:43 +0000 Subject: Fixed #849 --- .gitattributes | 1 + HISTORY | 1 + .../Javascripts/source/prado/datepicker/datepicker.js | 5 +++-- .../tickets/protected/pages/Ticket849.page | 5 +++++ .../tickets/tests/Ticket849TestCase.php | 18 ++++++++++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket849.page create mode 100644 tests/FunctionalTests/tickets/tests/Ticket849TestCase.php 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 @@ + + + + + \ 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 @@ +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 -- cgit v1.2.3