Development

#370 (Can't change the format in which a date is displayed using the input_date_tag helper.)

You must first sign up to be able to contribute.

Ticket #370 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Can't change the format in which a date is displayed using the input_date_tag helper.

Reported by: mweinric@imn.htwk-leipzig.de Assigned to:
Priority: minor Milestone: 1.0.0
Component: Version:
Keywords: format Cc:
Qualification:

Description

I need to show the date in the german way like 29.03.2006. If I pass the current date to input_date_tag helper with the option culture=de, it outputs simply 29.03.06 since the format is hardcoded to d in source:/trunk/lib/helper/FormHelper.php line 449.

The manual fix to this for the moment is to hardcode it to p.

Attachments

FormHelper.php (29.3 kB) - added by mweinric@imn.htwk-leipzig.de on 03/29/06 01:01:58.
Changed FormHelper?.php

Change History

03/29/06 01:01:58 changed by mweinric@imn.htwk-leipzig.de

  • attachment FormHelper.php added.

Changed FormHelper?.php

03/29/06 01:05:42 changed by mweinric@imn.htwk-leipzig.de

Sorry for the duplicate entry. On the first submit I received an internal server error. Please keep this one and delete Ticket # 369. Thanks.

03/30/06 12:07:20 changed by l2k <symfony-trac@cny.de>

A workaround would be to pass format_date($some_date, 'p') to the input helper.

03/30/06 21:37:18 changed by mweinric@imn.htwk-leipzig.de

I gues you mean like so: input_date_tag('datestart', format_date(date('Y-m-d', strtotime('-1 year')), 'p'), 'rich=true culture=de') Doesn't work either. You just can't override the default formatting that is applied to the date.

04/10/06 11:44:31 changed by fabien

  • milestone changed from 0.6.2 to 0.6.3.

06/16/06 09:46:47 changed by fabien

  • milestone changed from 0.6.3 to 1.0.0.

12/12/06 10:48:23 changed by chtito

  • status changed from new to closed.
  • resolution set to fixed.

You can use the format option

12/12/06 10:54:50 changed by chtito

(added in [2955] if you wanted to know)

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.