Skip to content

request for add new prefix on dateFormat #34

@lesar

Description

@lesar

I'm fighting to format date in DatePicker. I like to set dateFormat in js manner without any transformation. so in my project I have subclassed datePiker and changed the run method from line 142:

            if (strncmp($this->dateFormat, 'php:', 4) === 0) {
                    $this->clientOptions['dateFormat'] = FormatConverter::convertDatePhpToJui(substr($this->dateFormat, 4));
            } else {
                    $this->clientOptions['dateFormat'] = FormatConverter::convertDateIcuToJui($this->dateFormat, 'date', $language);
            }

to:

            if (strncmp($this->dateFormat, 'php:', 4) === 0) {
                    $this->clientOptions['dateFormat'] = FormatConverter::convertDatePhpToJui(substr($this->dateFormat, 4));
            } else if (strncmp($this->dateFormat, 'js:', 3) === 0) {
                    $this->clientOptions['dateFormat'] = substr($this->dateFormat, 3);
            } else {
                    $this->clientOptions['dateFormat'] = FormatConverter::convertDateIcuToJui($this->dateFormat, 'date', $language);
            }

I think that this can be usefoul and work very well.
Can you put this change in your code?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions