GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  WORKFLOW::VALIDATOR::MATCHESDATEFORMAT (3)

.ds Aq ’

NAME

Workflow::Validator::MatchesDateFormat - Ensure a stringified date matches a given pattern

CONTENTS

VERSION

This documentation describes version 1.06 of this package

SYNOPSIS



 <action name="CreateNews">
   <validator name="DateFormat">
      <param name="date_format" value="%Y-%m-%d"/>
      <arg value="$news_post_date"/>
   </validator>
 </action>



VERSION

This documentation describes version 1.04 of Workflow::Validator::MatchesDateFormat

DESCRIPTION

This validator ensures that a given date string matches a strptime pattern. The parameter ’date_format’ is used to declare the pattern against which the date string must be matched, and the single argument is the date to match.

The ’date_format’ pattern is a typical strptime pattern. See DateTime::Format::Strptime for details.

<B>NOTEB>: If you pass an empty string (or no string) to this validator it will not throw an error. Why? If you want a value to be defined it is more appropriate to use the ’is_required’ attribute of the input field to ensure it has a value.

Also, if you pass a DateTime object to the validator it will not determine whether the date is correct or within a range. As far as it is concerned its job is done.

    METHODS

_init

This method initializes the class and the enumerated class.

It uses add_enumerated_values to add the set of values for enumeration.

The primary parameter is value, which should be used to specify the either a single value or a reference to array of values to be added.

validate

The validator method is the public API. It works with Workflow.

Based on the initialized Workflow::Validator it validates a provided parameter, which should adhere to a predefined date format.

EXCEPTIONS

o You must define a value for ’date_format’ in declaration of validator <name>
o The value for ’date_format’ must be a simple scalar in declaration of validator <name>
o Date ’<date_string>’ does not match required pattern <pattern>

SEE ALSO

Workflow
Workflow::Validator
Workflow::Exception
DateTime

COPYRIGHT

Copyright (c) 2003-2007 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Current maintainer Jonas B. Nielsen <jonasbn@cpan.org>

Original author Chris Winters <chris@cwinters.com>

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WORKFLOW::VALIDATOR::MATCHESDATEFORMAT (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.