| Jifty documentation | Contained in the Jifty distribution. |
Jifty::Web::Form::Field::DateTime - Add date pickers to your forms
Output date fields with the class 'date'
If the value is a DateTime, return nothing if the epoch is 0
| Jifty documentation | Contained in the Jifty distribution. |
use warnings; use strict; package Jifty::Web::Form::Field::DateTime; use base qw/Jifty::Web::Form::Field/;
sub classes { my $self = shift; return join(' ', 'datetime', ($self->SUPER::classes)); }
sub canonicalize_value { my $self = shift; my $value = $self->current_value; if (UNIVERSAL::isa($value, 'DateTime')) { return unless $value->epoch; } return $value; } 1;