[ 
https://issues.apache.org/jira/browse/NIFI-3427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15849282#comment-15849282
 ] 

James Wing commented on NIFI-3427:
----------------------------------

[~jrittenh], thanks for spotting and reporting this issue today, since today is 
probably the best day of the year to identify the underlying problem.  NiFi 
converts the displayed dates into an internal Javascript Date for sorting, and 
it looks like there is a bug in this conversion (nf.Common.parseDateTime).

||Sample Parse Command||Results||
|nf.Common.parseDateTime("01/31/2017 23:55:13.079 UTC")|Fri Mar 03 2017 
23:55:13 GMT-0800 (Pacific Standard Time)|
|nf.Common.parseDateTime("02/01/2017 00:05:34.793 UTC")|Wed Mar 01 2017 
00:05:34 GMT-0800 (Pacific Standard Time)|
|nf.Common.parseDateTime("02/02/2017 00:11:53.189 UTC")|Thu Mar 02 2017 
00:11:53 GMT-0800 (Pacific Standard Time)|

We construct a Date object passing in month as an integer 1 - 12, but Date() 
actually accepts months 0 - 11.  Normally, we don't notice because it is 
consistently off by one month and that's close enough for sorting work.  
However, the difference between January 31st and February 1st is more dramatic 
because Javascript's Date also allows us to ask for February 31st, which it 
quietly and helpfully renders as March 3rd.  Meanwhile, February 1st becomes 
March 1st, and the sorting is more wildly off than it might be at the ends of 
other months.

I will open a pull request with a fix.

> Data Provenance date/time sort ignores the date
> -----------------------------------------------
>
>                 Key: NIFI-3427
>                 URL: https://issues.apache.org/jira/browse/NIFI-3427
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core UI
>    Affects Versions: 1.1.1
>            Reporter: Justin Rittenhouse
>            Assignee: James Wing
>            Priority: Minor
>         Attachments: Screen Shot 2017-02-01 at 9.49.11 AM.png
>
>
> The Data provenance display window that pops up doesn't properly sort by 
> date/time.  It sorts by time, with events dated 11pm from January 31 
> appearing before/after (depending on ascending or descending sort) events 
> dated February 1 before 11pm.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to