aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/date_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* So not make Fixnum#/ private on Ruby verions less than 1.9.3Rafael Mendonça França2013-05-101-4/+3
| | | | In those version to_date call Fixnum#/, what will cause a failure
* Merging in fix from #8222Ben Tucker2013-05-061-0/+5
|
* Make distance_of_time_in_words work with DateTime offsetsAndrew White2012-12-041-0/+10
| | | | | | | | | | | | | | | Because DateTime#to_time returns self when it has a non-zero offset and subtracting two DateTime instances returns a Rational then the distance_of_time_in_words methods outputs an incorrect value. This is fixed in master because we can rely on Ruby 1.9.3's implementation of to_time but it can't be fixed on Ruby 1.8.7 as there is no way to map the DateTime to a Time with a non-zero offset. We can workaround the problem by casting to Float before doing the subtraction in the distance_of_time_in_words method. Closes #8390
* Make output of distance_of_time_in_words consistentAndrew White2012-12-041-2/+19
| | | | | | | | | | This commit fixes the output of distance_of_time_in_words when using integer or duration arguments. Previously a distance of more than 30 seconds would be output as 'Less than 1 minute' when using integer arguments and '1 minute' when using two Time instances more than 30 seconds apart. Cherry picked from 5fdd4cd9e47be972f146a8a17a74c8f4700e2ac0
* correct handling of date selects when using both disabled and discard optionsVasiliy Ermolovich2012-08-251-0/+24
| | | | | | | | | | | | we should take disabled option not only from `html_options` hash but from `options` hash too like `build_select` method does it. So datetime_select("post", "updated_at", { :discard_minute => true }, { :disabled => true }) datetime_select("post", "updated_at", :discard_minute => true , :disabled => true) both these variants work now closes #7431
* Merge pull request #4639 from joevandyk/datetime-infinity-select-fixAaron Patterson2012-01-241-0/+12
|\ | | | | datetime_select fix for dates of -infinity and +infinity
| * datetime_select should work with -/+ infinity datesJoe Van Dyk2012-01-241-0/+12
| |
* | Remove unused variables to avoid warningsRafael Mendonça França2012-01-241-3/+0
| |
* | Fix date_select with discard_month and discard_year optionsRafael Mendonça França2012-01-241-0/+37
| | | | | | | | Closes #4553 and #4633
* | Fix date_select nil and blank and order caseIndrek Juhkam2012-01-241-17/+1
| |
* | Add failing test for date_selectIndrek Juhkam2012-01-241-0/+16
|/ | | | | date_select does not work when day is discarded, include blank option is enabled and struct date itself is nil.
* fix separator insertion in date_select helperSergey Nartimov2011-12-141-0/+19
|
* Added :use_two_digit_numbers option [Lennart Fridén & Kim Persson]Lennart Fridén2011-12-111-1/+18
| | | | | | | | | | Added use_two_digit_numbers select_tag option for displaying months and days with leading zeros without affecting the values (useful for e.g. ISO-style dates, 2011-08-01). Signed-off-by: José Valim <jose.valim@gmail.com> Conflicts: actionpack/CHANGELOG.md
* Fixes an issue when creating a date select with too many options.Liborio Cannici2011-10-081-0/+9
| | | | | | | | | | Inspired by dlt https://github.com/dlt/rails/commit/9e615634745dc81598e7b880d52411338d3a7a93 Closes #239. Conflicts: actionpack/CHANGELOG
* Merge pull request #343 from asanghi/ampmJosé Valim2011-05-071-0/+55
|\ | | | | Allow AM/PM format in datetime selectors
| * Allow AM/PM in datetime selectorsAditya Sanghi2011-04-291-0/+55
| |
* | Take leap years into account more seriously when calculating year distance ↵Aditya Sanghi2011-05-061-0/+4
|/ | | | [#6074 state:resolved]
* Fixing distance_of_time_in_words range near 2 daysMatt Duncan2011-04-131-3/+3
|
* Remove 'warning: ambiguous first argument' when running ActionPack testsSebastian Martinez2011-03-291-2/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Merge branch 'master' into nested_has_many_throughJon Leighton2011-03-041-5/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb
| * updated Time, Date and DateTime current methods in AS to use Time.zone and ↵Josh Kalderimis2011-02-281-2/+2
| | | | | | | | | | | | not Time.zone_default. [#6410 state:committed]
| * Allow for the format of time_tag in AP to be changed via an option argument.Josh Kalderimis2011-02-121-5/+11
| | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * Added time_tag helper to AP for HTML5 time tag [#5919 state:resolved]Sjoerd Andringa2011-02-121-1/+21
|/ | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* patching to ensure separator is printed with order [#5816 state:resolved]Aditya Sanghi2010-11-111-0/+41
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Remove duplicated test.Emilio Tagua2010-09-281-20/+0
|
* These tests shouldn't depend on local time to pass or fail, we can use utc here.Emilio Tagua2010-09-241-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-14/+14
| | | | 's/[ \t]*$//' -i {} \;)
* Fixed date_select date_separator when discard_month and/or discard_day are ↵Thibaud Guillaume-Gentil2010-06-201-0/+27
| | | | | | true [#4856 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix form builder and form helpers inconsistencies [#4432 state:resolved]Neeraj Singh2010-04-291-21/+80
| | | | | | | | * datetime_select and select_datetime should be consistent as much as possible * date_select and select_date should be consistent as much as possible * time_select and select_time should be consistent as much as possible Signed-off-by: José Valim <jose.valim@gmail.com>
* Make form helpers work with <%= wycats2010-03-091-7/+7
|
* Adds disable option to date_helpers generated hidden fields when ↵Santiago Pastorino2010-03-051-0/+55
| | | | | | | | html_options specifies it. ht by Marc Schütz [#3807 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* add time_separator for minutes only if minutes aren't hiddenSantiago Pastorino2010-02-251-0/+41
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed that much of DateHelper wouldn't return html_safe? strings [DHH]David Heinemeier Hansson2010-01-081-0/+22
|
* Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 ↵John Trupiano2009-09-281-12/+27
| | | | | | | days return '2 days'. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3266 state:committed]
* Enhancing distance_of_time_in_words to prefix year output with over and ↵Jay Pignata2009-09-281-7/+8
| | | | | | | about depending upon how many months have elapsed Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3106 state:committed]
* Stops date select helpers from defaulting the selected date to today if ↵Sam Oliver2009-02-131-14/+14
| | | | | | | :prompt option has been used Signed-off-by: Michael Koziarski <michael@koziarski.com> [#561 state:resolved]
* Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha.Jeremy Kemper2009-02-031-34/+32
|
* Fix date_select within fields_for with an index [#1666 state:resolved] ↵Josh2009-01-161-15/+80
| | | | | | [Josh, Frederick Cheung] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Added prompt options to date helpers [#561 state:resolved]Sam Oliver2008-12-211-0/+321
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix regression bug that made date_select and datetime_select raise a Null ↵Bernardo de Pádua2008-11-041-0/+40
| | | | | | Pointer Exception when a nil date/datetime was passed and only month and year were displayed [#1289 state:committed] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Refactor DateHelper to use DateTimeSelector presenter patternClemens Kofler2008-08-071-50/+249
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Fix file permissionsTarmo Tänav2008-07-311-0/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Refactor DateHelper and improve test coverage [#665 state:resolved]Clemens Kofler2008-07-211-48/+96
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Allow date helpers to ignore date hidden field tags. [#503 state:resolved]miloops2008-07-041-0/+15
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure FormBuilder date helpers respects html_options. [#506 state:resolved] ↵Pratik Naik2008-06-291-8/+55
| | | | | | [Pascal Ehlert] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Use output_buffer reader and writer methods exclusively instead of hitting ↵Jeremy Kemper2008-06-081-8/+4
| | | | the instance variable so others can override the methods.
* Work with @output_buffer instead of _erboutJeremy Kemper2008-06-021-6/+6
|
* InstanceTag#default_time_from_options overflows to DateTimegbuesing2008-05-181-0/+6
|
* ActionView::InstanceTag#default_time_from_options with hash args uses ↵gbuesing2008-05-081-0/+23
| | | | Time.current as default; respects hash settings when time falls in system local spring DST gap
* Adding Date.current, which returns Time.zone.today if config.time_zone is ↵gbuesing2008-05-081-0/+9
| | | | set; otherwise returns Date.today. ActionView date_helper uses Date.current to determine locale-appropriate default