Development

#2570 (Datetime without time)

You must first sign up to be able to contribute.

Ticket #2570 (closed defect: fixed)

Opened 1 year ago

Last modified 5 months ago

Datetime without time

Reported by: Edir.Dumaszak Assigned to: FabianLange
Priority: major Milestone: 1.1.0
Component: generator Version: 1.0.8
Keywords: I18N, datetime, timestamp, crud, generator Cc:
Qualification: Unreviewed

Description

I have a field of a table in schema.yml this:

    data_inscricao: 
      type: TIMESTAMP
      required: true

I used the command 'symfony propel-13-generate-crud' to generate the admin, but the Time is not being saved. I reviewed the code and saw that the problem in this part of actions.class.php:

if ($this->getRequestParameter('datetime_message'))
    {
      list($d, $m, $y) = sfI18N::getDateForCulture($this->getRequestParameter('datetime_message'), $this->getUser()->getCulture());
      $test->setDatetimeMessage("$y-$m-$d");
    }

The sfI18N::getDateForCulture() only returns the date, not the time.

This has been reviewed in the forum: http://www.symfony-project.com/forum/index.php/m/22357/

The solution, I believe be creating 'sfI18N:getDateTimeForCulture()' that supports DateTime?. Added an pacth based on the topic of the forum.

Attachments

sI18n.patch (1.7 kB) - added by Edir.Dumaszak on 11/22/07 14:29:28.
pacth for I18n
PropelCrud.patch (1.5 kB) - added by Edir.Dumaszak on 11/22/07 15:08:01.
Template for Crud

Change History

11/22/07 14:29:28 changed by Edir.Dumaszak

  • attachment sI18n.patch added.

pacth for I18n

11/22/07 15:08:01 changed by Edir.Dumaszak

  • attachment PropelCrud.patch added.

Template for Crud

12/27/07 16:58:47 changed by fabien

  • milestone set to 1.1.0.

06/25/08 12:58:20 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.
  • milestone changed from 1.1.0 to 1.1.0 FINAL.

it will use the i18n change from #2896

06/25/08 13:11:50 changed by FabianLange

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

(In [9853]) 1.1: fixed I18N timestamp handling, using Dustins r9760 + added tests. closes #2896, #2570.

06/29/08 23:38:31 changed by FabianLange

  • milestone changed from 1.1.0 FINAL to 1.1.0.