Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Problems with localized date/datetime format #89

Open
DarkSide666 opened this Issue · 5 comments

2 participants

@DarkSide666

I tried to use custom locale for date / datetime fields (default is d/m/Y H:i:s) like this in my config.php file:
$config['locale']['date'] = 'Y.m.d';
$config['locale']['datetime'] = 'Y.m.d H:i:s';

It only looks good for formatting output of data in grids, forms etc., but everywhere else it's not working:
1) Calendar widget don't understand this format and don't recognize inputted data.
2) When I choose some other date in calendar widget, then it returns date in default format d/m/Y.
3) When I try to save form / model with datetime in format Y.m.d H:i:s, then it saves incorrect date 1970.01.01 etc...

It looks, that config[locale][date] and [datetime] are implemented only for showing datetime as text output and nothing more :(

@DarkSide666

Nope.

1) Is solved by setting $config['locale']['date_js'] = 'yy.mm.dd';
2) Also is solved with above changes in date_js config.
3) It's now slightly better - it understands only year correctly and saves it, but changes in day and month part of the date can't be saved...

@romaninsh
Owner

so what is the actual issue here? I'm confused.

@DarkSide666

It's quite hard to explain. I'll get back to this later on my project and then extend this issue description.
I'll have vacation next week and hopefully will be completely away from all modern technologies :)

@romaninsh
Owner

oh, have a nice vacation! hope to see you wednesday after next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.