Comments (8)
i had the same issue but when i gave it like this
<?= $form->field($model, 'dob')->widget(
DatePicker::className(),
[
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]
); ?>
instead of
<?= DatePicker::widget([
'model' => $model,
'attribute' => 'dob',
'template' => '{addon}{input}',
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]);?>
it started to work.
from yii2-date-picker-widget.
Could be that you hace changed its template
from yii2-date-picker-widget.
No, i didn't modify the template in any way this is my view code
<?= DatePicker::widget([
'model' => $model,
'attribute' => 'dob',
'template' => '{addon}{input}',
'clientOptions' => [
'format' => 'L',
'autoclose' => true,
'format' => 'yyyy-mm-dd',
'endDate'=> '1970-12-31',
]
]);?>
from yii2-date-picker-widget.
'template' => '{addon}{input}',
What if we use:
<?= $form->field($model, 'dob')->widget(
DatePicker::className(),
[
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]
); ?>
from yii2-date-picker-widget.
Hey, have the same issue - any updates on this one?
from yii2-date-picker-widget.
@philippfrenze I need more info as I do use the widget and certainly the validation happens.
from yii2-date-picker-widget.
use regx and preg_match($format, $date) after get time and check valid time ,u can define validator in model
from yii2-date-picker-widget.
@mahesheu already gave the solution and is as I suspected on the client side for the template.
The problem on the server could be that somehow the dob
is filled with values and thats why is not firing when validating. The solution provided by @faniuta could be the best and also including trim
filter on our rules too.
from yii2-date-picker-widget.
Related Issues (20)
- Make property DateRangePicker::_template protected instead private HOT 3
- Using as a time picker only has broken date header HOT 1
- Dependant Datepickers HOT 1
- Bootstrap-datepicker trigger 'show.bs.modal' when it is displayed HOT 2
- The missing file: 'js/bootstrap-datepicker.js'. HOT 3
- Calendar does not pop up HOT 5
- datepicker.css not found HOT 4
- Date 'format' is not respected on 'Update'. HOT 1
- If the date is 0000-00-00 HOT 1
- using daterangepicker in gridview documentation not given HOT 1
- Localize
- Clear button problem HOT 3
- Is not installing properly, why? HOT 2
- I recently discovered that using the plug-in bootstrap drop-down menu can't be used. What should I do HOT 8
- Selected date does not set in form
- 0000-00-00 00:00:00 value on save HOT 3
- dateFormat yyyy-M-dd does not work well when I set the language to zh-CN
- No work in modal HOT 1
- The file or directory to be published does not exist: vendor/bower/bootstrap-datepicker/dist HOT 1
- Extra Asset included in DatePickerLanguageAsset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-date-picker-widget.