Code Monkey home page Code Monkey logo

yii2-datetime-widget's People

Contributors

beaten-sect0r avatar ddinchev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

yii2-datetime-widget's Issues

Output 1970-01-01 00:00:00 on Empty String

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 !== '') {

Invalid Parameter – yii\base\InvalidParamException

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';

Indonesian format

Dear..

How to add indonesian format in "phpDatetimeFormat",
which is dd-MM-yyyy HH:MM ?

Exception Thrown when KeepInvalid is set a true

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);
}

timezone problem

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',
        ]
    ])`

Failed to parse time string (16/08/2016 00:00) at position 0 (1)

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.

Demo

Cannot sign into Demo . Passwords does not work.

Not work if two datetimepicker in modal bootstrap.

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.

use strtorime

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.