NAME

DateTimeX::Format::CustomPattern - A Moose::Role for building DateTime Formats that require patterns

DESCRIPTION

This role must be composed before DateTimeX::Format.

It adds an attribute "pattern", and behavies consistant with the call-overriding environment of DateTimeX::Format.

SYNOPSIS

package DateTimeX::Format::RequiresPattern;
with 'DateTimeX::Format::CustomPattern';
with 'DateTimeX::Format';

package main;

my $dt = DateTimeX::Format::RequiresPattern->new({
	locale     => $locale
	, timezone => $timezone
	, pattern  => '%H:%M:%S'
	, debug    => 0|1
	, defaults => 0|1
});

$dt->parse_datetime( $time, {pattern => '%H:%M'} );

OBJECT ENVIRONMENT

All of these slots correspond to your object environment: they can be supplied in the constructor, or through accessors.

  • pattern( $str )

    Can be overridden in the call to ->parse_datetime.