[Dbix-class] Re: Patch for DBIx::Class::InflateColumn::DateTime

Sergio Salvi sergio.lists at salvi.ca
Sun Oct 7 21:37:10 GMT 2007


On 10/7/07, Ash Berlin <ash_cpan at firemirror.com> wrote:
> Sergio Salvi wrote:
> > On 9/19/07, Ash Berlin <ash at firemirror.com> wrote:
> >> Sergio Salvi wrote:
> >>> Hi Matt, Ash,
> >>>
> >>> I have a patch for DBIx::Class::InflateColumn::DateTime to add support
> >>> for timezones. It allows one to specify that a DATE or DATETIME field
> >>> is stored in a specific timezone instead of the default (UTC). It's
> >>> here: http://scsys.co.uk:8001/9505
> >> DateTime's come out in Floating, not UTC btw.
> >>> I've checked out trunk, wrote tests and documentation. Could you
> >>> please look at it and, hopefully, apply it?
> >>>
> >>> Thanks,
> >>> Sergio
> >> Looks like a promising start. Could you just make the following changes:
> >>
> >> - Move the TZ into the extra hash:
> >>
> >>   starts_at => { data_type => 'datetime', extra => { timezone =>
> >> "America/Chicago" } },
> >>
> >> - Make default convert from what ever timezone the incoming $obj is to
> >> the one set in the column. Without this you can't guarantee that all
> >> values of the column have the stated timezone.
> >>
> >>
> >
> > (copying the DBIC list now)
> >
> > Here is the updated patch according to your suggestions. I've added
> > more tests also.
> >
> > Let me know what you and others think.
> >
> > Thanks,
> > Sergio
> >
> >
>
> Your patch doesn't seem to be a fully difference from the repository
> version - it has differences for a file
> t/lib/DBICTest/Schema/EventTZ.pm, but this does not exist yet.
>
> Please regen the patch.
>

That file is a new one, created with "svn copy Event.pm EventTZ.pm".

The patch was created with "svn diff --diff-cmd diff". What's the correct way?

Also, FYI:

[dndev at dn1 ~/svn/DBIx-Class/0.08/trunk]$ svn up
At revision 3808.
[dndev at dn1 ~/svn/DBIx-Class/0.08/trunk]$ svn stat
?      META.yml
?      README
?      pm_to_blib
?      inc
M      t/89inflate_datetime.t
A  +   t/lib/DBICTest/Schema/EventTZ.pm
M      t/lib/DBICTest/Schema.pm
M      lib/DBIx/Class/InflateColumn/DateTime.pm

Sergio



More information about the DBIx-Class mailing list