aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/date_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* fixing the ternary operation where the logic is very confusing.Neeraj Singh2010-07-181-1/+2
| | | | | | [#5136 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* removed 'unless const_defined?' code smellJosh Kalderimis2010-06-211-2/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge remote branch 'rails/master'Xavier Noria2010-06-201-2/+4
|\ | | | | | | | | Conflicts: actionpack/lib/abstract_controller/base.rb
| * Fixed date_select date_separator when discard_month and/or discard_day are ↵Thibaud Guillaume-Gentil2010-06-201-2/+4
| | | | | | | | | | | | true [#4856 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Adds title and description where needed.Rizwan Reza2010-06-161-0/+2
|/
* removing the extra assignment statement [#4432 state:resolved]Neeraj Singh2010-04-301-1/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix form builder and form helpers inconsistencies [#4432 state:resolved]Neeraj Singh2010-04-291-43/+33
| | | | | | | | * 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>
* Adds disable option to date_helpers generated hidden fields when ↵Santiago Pastorino2010-03-051-1/+2
| | | | | | | | 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-1/+1
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* content_tag should escape its inputBruno Michel2010-02-141-3/+3
| | | | Signed-off-by: Yehuda Katz <yehudakatz@YK.local>
* For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-7/+7
| | | | | | | | | | | | Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.
* Fixed that much of DateHelper wouldn't return html_safe? strings [DHH]David Heinemeier Hansson2010-01-081-5/+5
|
* Switch to on-by-default XSS escaping for rails.Michael Koziarski2009-10-081-3/+3
| | | | | | | | | | | | This consists of: * String#html_safe! a method to mark a string as 'safe' * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it * Calls to String#html_safe! throughout the rails helpers * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB) * New ERB implementation based on erubis which uses a SafeBuffer instead of a String Hat tip to Django for the inspiration.
* Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 ↵John Trupiano2009-09-281-10/+19
| | | | | | | 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-4/+7
| | | | | | | about depending upon how many months have elapsed Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3106 state:committed]
* Merge docrailsPratik Naik2009-07-251-5/+5
|
* Merge docrailslifo2009-04-171-3/+3
|
* Merge docrailsPratik Naik2009-03-161-2/+2
|
* Stops date select helpers from defaulting the selected date to today if ↵Sam Oliver2009-02-131-1/+1
| | | | | | | :prompt option has been used Signed-off-by: Michael Koziarski <michael@koziarski.com> [#561 state:resolved]
* Fix date_select within fields_for with an index [#1666 state:resolved] ↵Josh2009-01-161-5/+5
| | | | | | [Josh, Frederick Cheung] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Use I18n for date/time select helpers prompt text [#561 state:resolved]Sam Oliver2008-12-221-6/+2
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added prompt options to date helpers [#561 state:resolved]Sam Oliver2008-12-211-0/+79
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Merge docrailsPratik Naik2008-12-191-1/+1
|
* use :en as a default locale (in favor of :en-US)Sven Fuchs2008-11-181-1/+1
| | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Fix regression bug that made date_select and datetime_select raise a Null ↵Bernardo de Pádua2008-11-041-2/+2
| | | | | | 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>
* Merge with docrails. Also add a rake task to generate guides in your rails ↵Pratik Naik2008-10-211-6/+6
| | | | | | | | application : rake doc:guides The rake task will generate guides inside doc/guides directory of your application. Open index.html to browse.
* Refactor DateHelper to use DateTimeSelector presenter patternClemens Kofler2008-08-071-198/+378
| | | | 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-156/+142
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Merge branch 'master' into i18n-mergeJeremy Kemper2008-07-171-2/+2
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_view/helpers/form_options_helper.rb activerecord/lib/active_record/validations.rb
| * Merge with docrails.Pratik Naik2008-07-161-2/+2
| |
* | merge forward to current rails/masterSven Fuchs2008-07-161-19/+31
|\|
| * Allow date helpers to ignore date hidden field tags. [#503 state:resolved]miloops2008-07-041-2/+5
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Remove unused local_binding option to InstanceTag's ConstructorMichael Koziarski2008-07-031-3/+3
| |
| * Remove nested ternary operators from select_year in favour of conditionals.Michael Koziarski2008-07-031-11/+20
| |
| * Ensure FormBuilder date helpers respects html_options. [#506 state:resolved] ↵Pratik Naik2008-06-291-3/+3
| | | | | | | | | | | | [Pascal Ehlert] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | align with changes in i18nSven Fuchs2008-07-061-3/+2
| |
* | remove core extensions in favor of I18n#translate and I18n#localizeSven Fuchs2008-07-021-2/+3
| |
* | remove call to self.locale from helpersSven Fuchs2008-06-231-4/+1
| |
* | check self.locale instead of request.locale in helpersSven Fuchs2008-06-221-2/+2
| |
* | integrating I18n into RailsSven Fuchs2008-06-191-33/+48
|/
* InstanceTag#default_time_from_options overflows to DateTimegbuesing2008-05-181-1/+1
|
* ActionView::InstanceTag#default_time_from_options with hash args uses ↵gbuesing2008-05-081-3/+4
| | | | 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-1/+1
| | | | set; otherwise returns Date.today. ActionView date_helper uses Date.current to determine locale-appropriate default
* Improve documentation coverage and markupXavier Noria2008-05-021-4/+4
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* select_datetime and select_time default to Time.zone.now when ↵gbuesing2008-04-211-2/+2
| | | | config.time_zone is set
* datetime_select defaults to Time.zone.now when config.time_zone is setgbuesing2008-04-211-1/+1
|
* Docfix (closes #11263) [Irfy]David Heinemeier Hansson2008-03-151-21/+21
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9031 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow html_options to be passed to all the date helpers. Closes #6000 ↵Michael Koziarski2008-03-021-36/+49
| | | | | | [h-lame, Jakob S] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8968 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make date_helper use tag and content_tag. Move to assert_dom_equal instead ↵Michael Koziarski2008-02-201-18/+26
| | | | | | of assert_equal to avoid being dependent on hash ordering. Closes #11131 [ernesto.jimenez] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8911 5ecf4fe2-1ee6-0310-87b1-e25e094e27de