Issue 88 in sekati: StringValidator validateDate, validateUSState

0 views
Skip to first unread message

sek...@googlecode.com

unread,
Nov 17, 2010, 5:24:43 PM11/17/10
to sekat...@googlegroups.com
Status: New
Owner: sekati
Labels: Type-Enhancement Priority-Low Milestone-0.x.x.x

New issue 88 by sekati: StringValidator validateDate, validateUSState
http://code.google.com/p/sekati/issues/detail?id=88

Purpose of the enhancement request:

Add further string form validations

Would this request break the existing API, add new functionality or both?

Add new functionality.

Please use labels, example code and attachments to provide additional info:

/**
* Validate a string as a date formatted: mm/dd/yyyy.
* @see http://www.regular-expressions.info/regexbuddy/datemmddyyyy.html
*/
private function validateDate(str : String) : Boolean {
var dateExpression : RegExp = /(0[1-9]|1[012])[\/](0[1-9]|[12][0-9]|
3[01])[\/](19|20)[0-9]{2}/;
return dateExpression.test( str );
}

/**
* Validate US State
*/
private function validateUSState(state : String) : Boolean {
var stateArray : Array = config.state['select'].split( ',' );
return ArrayUtil.contains( stateArray, state );
}

sek...@googlecode.com

unread,
Dec 1, 2010, 11:52:10 AM12/1/10
to sekat...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 88 by sekati: StringValidator validateDate,
validateUSState
http://code.google.com/p/sekati/issues/detail?id=88

Added StringValidator.isUSState( state:String ):Boolean &
StringValidator.isValidDate(date:String):Boolean - the later should not be
confused with DateUtil.isValidDate(year:Number, month:Number, day:Number,
mustBeInPast:Boolean):Boolean, Also refactored
StringValidator.validatePhone to StringValidator.isValidPhone

Reply all
Reply to author
Forward
0 new messages