Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Format #37

Open
kaosou opened this issue Feb 16, 2014 · 1 comment
Open

Date Format #37

kaosou opened this issue Feb 16, 2014 · 1 comment

Comments

@kaosou
Copy link

kaosou commented Feb 16, 2014

Would like to propose changes to FilterPaneUtils on parsing date string.
This would allow javascript dateformat to be parse.

//private static String df = 'EEE MMM dd HH:mm:ss zzz yyyy'
private static String[] df = ["yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", 'EEE MMM dd HH:mm:ss zzz yyyy']
private static final Log log = LogFactory.getLog(this)

static Date parseDateFromDatePickerParams(paramProperty, params) {
    try {
        if(params[paramProperty] instanceof Date) {
            return params[paramProperty]
        }

        if(params[paramProperty] instanceof String) {
            for(int i = 0; i < df.length; i++)
            {
                  try {
                    return new SimpleDateFormat(df[i]).parse(params[paramProperty]?.toString())
                } catch(Exception ex) {
                    /* Do nothing. */
                    log.debug("Parse exception for ${paramProperty} : ${params[paramProperty]}: ${ex.message} with Format ${df[i]}")
                }
              }
        }

.
.
.

@ctoestreich
Copy link
Member

Will be in 2.4.5

ctoestreich pushed a commit that referenced this issue Jul 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants