kartik-v / yii2-datecontrol

Date control module allowing separation of date formats for View & Model for Yii Framework 2.0.
http://demos.krajee.com/datecontrol
Other
55 stars 29 forks source link

Incorrect year in saveFormat, when displayFormat "d M" #117

Closed Wofik29 closed 5 years ago

Wofik29 commented 6 years ago

Prerequisites

Steps to reproduce the issue

  1. Just view DateControl on follow parameters and set something value
\kartik\datecontrol\DateControl::widget([
        'name' => 'from',
        'value' => date('Y-m-d'),
        'type' => \kartik\datecontrol\DateControl::FORMAT_DATE,
        'displayFormat' => 'php:d M',
        'saveFormat' => 'php:Y-m-d',
]);

I want see only day and month and save simple format

  1. Next, I see on page and in debug tools all fine. _033

  2. Chage date

Expected behavior and actual behavior

When I follow those steps, I see 1970 year _034 I was expecting that year not be changed.

I see date format http://php.net/manual/en/datetime.formats.date.php Format "d M", for example "17 Apr", should be parse.

I do something wrong?

Environment

Browsers

Operating System

Libraries

Isolating the problem

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.