trntv / yii2-datetime-widget Goto Github PK
View Code? Open in Web Editor NEWYii2 Date/Time Widget
Yii2 Date/Time Widget
When the form is submitted with empty string it will generate 1970-01-01 00:00:00
is this expected behaviour?
as I don't like it, I do a quick fix by changing line 104 to
if ($value !== null && $value !== '') {
Hi,
I got the error:
The file or directory to be published does not exist: vendor/bower/eonasdan-bootstrap-datetimepicker
i replace this
public $sourcePath = '@bower/eonasdan-bootstrap-datetimepicker';
public $sourcePath = '@bower/moment';
for this
public $sourcePath = '@bower/bower-asset/eonasdan-bootstrap-datetimepicker';
public $sourcePath = '@bower/bower-asset/moment';
Dear..
How to add indonesian format in "phpDatetimeFormat",
which is dd-MM-yyyy HH:MM ?
When we have KeepInvalid option set as true and we submit a not supported date (ex 2018-10-10 10) we get an Exception thrown.
The problem happens here when call Yii::$app->formatter->asDatetime("2018-10-10 10") to a wrong date
$this->options['value'] = array_key_exists('value', $this->options)
? $this->options['value']
: Yii::$app->formatter->asDatetime($value, $this->phpDatetimeFormat);
}
My
$model->date_s = 2017-03-06 19:00:00
But the input field default is
2017-03-06T20:00:00+0100
if in phpDatetimeFormat i insert eg yyyy-MM-DD HH:mm:ss
i've error because is not in your protected $defaultPhpMomentMapping
this is the config
`
$form->field($model_post, 'schedule')->widget(
'trntv\yii\datetime\DateTimeWidget',
[
'phpDatetimeFormat' => 'yyyy-MM-dd\'T\'HH:mm:ssZZZZZ',
'clientOptions' => [
//'inline' => true,
'minDate' => new \yii\web\JsExpression('new Date("' . $date->format('Y-m-d') . '")'),
'allowInputToggle' => true,
'sideBySide' => true,
'locale' => 'it-IT',
'disabledDates' => $date_disabled,
'widgetPositioning' => [
'horizontal' => 'auto',
'vertical' => 'auto'
],
//'format' => 'dddd d MMMM YYYY : HH:mm',
'stepping' => '30',
]
])`
How to open picker on input field click event ?
Which option is responsible for this?
Until recently update, it was by default.
Hi,
Thanks for creating this widget. I installed it successfully but I cannot set 'MM/dd/yyyy HH:mm' format for phpDatetimeFormat, it allows me to set following format:
'phpDatetimeFormat' => 'dd/MM/yyyy HH:mm',
Hence I cannot submit dates which are more than 12 because I get following error:
'16/08/2016 00:00' is not a valid date time value: DateTime::__construct(): Failed to parse time string (16/08/2016 00:00) at position 0 (1): Unexpected character
Could you please help me.
Cannot sign into Demo . Passwords does not work.
I got such a mistake, which is caused by what is the problem?
locale() locale zh is not loaded from moment locales!
Dear trntv,
if i have 2 datetimepicker, the first is success,
but the second have an error like this :
Uncaught Error: Could not initialize DateTimePicker without an input element
at c (:2:2239)
at HTMLButtonElement.
hello,
how to use this widget with strtotime ?
i want to use this widget for date range search and my table date use integer type data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.