Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
a40aabbb
Commit
a40aabbb
authored
Sep 07, 2012
by
Franz Liedke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement date_format validation rule.
parent
49331d74
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
application/language/en/validation.php
+1
-0
laravel/validator.php
+13
-0
No files found.
application/language/en/validation.php
View file @
a40aabbb
...
...
@@ -36,6 +36,7 @@ return array(
"countbetween"
=>
"The :attribute must have between :min and :max selected elements."
,
"countmax"
=>
"The :attribute must have less than :max selected elements."
,
"countmin"
=>
"The :attribute must have at least :min selected elements."
,
"date_format"
=>
"The :attribute must have a valid date format."
,
"different"
=>
"The :attribute and :other must be different."
,
"email"
=>
"The :attribute format is invalid."
,
"exists"
=>
"The selected :attribute is invalid."
,
...
...
laravel/validator.php
View file @
a40aabbb
...
...
@@ -759,6 +759,19 @@ class Validator {
}
/**
* Validate the date conforms to a given format.
*
* @param string $attribute
* @param mixed $value
* @param array $parameters
* @return bool
*/
protected
function
validate_date_format
(
$attribute
,
$value
,
$parameters
)
{
return
date_create_from_format
(
$parameters
[
0
],
$value
)
!==
false
;
}
/**
* Get the proper error message for an attribute and rule.
*
* @param string $attribute
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment