Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1746

Correct time parsing in date range filter

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.2-B3
    • Component/s: Data Management
    • Labels:
      None

      Description

      1. in "\kDateFormatter::Parse" method: - 0.2h
        • add optional (defaults to "null") $format parameter
        • when $format parameter isn't specified (existing code), then take it's value from "input_format" field option
      2. in "\kSearchHelper::_getInputTimeFormat" method: - 0.3h
        • add optional (defaults to "input_time_format") "$format_option_name" parameter
        • in call sites (found 1 place) specify "input_time_format" as 2nd parameter value
        • use str_replace/ucwords function combo to create "$lang_current" object field name from "$format_option_name" parameter value
      3. in "\kSearchHelper::processRangeField" method: - 1h
        • add optional (default to "") $format_option_prefix parameter
        • when time is missing, then always add time for "00:00:00" instead of dynamically getting time based on field type
        • when calling "\kSearchHelper::_getInputTimeFormat" method instead of "input_time_format" specify $format_option_prefix . 'time_format'
        • before calling "$formatter->Parse":
          • set "$format" variable (new) to the $options[$format_option_prefix . 'format'] value
          • specify $format variable as $format argument of "\kDateFormatter::Parse" method call
        • if there was an error during date parsing and $format_option_prefix parameter is empty, then instead of returning "false" return result of calling "\kSearchHelper::processRangeField" method with same parameters, except that $format_option_prefix argument would be set to "input_"
      4. in "\kSearchHelper::getCustomFilterSearchClause" method, when handling "date_range" filter type: - 0.5h
        • do the from/to guessing when either of them is specified ONLY, when time is absent in specified date
        • when $to is specified, but missing a time, then add 23:59:59 time to it
        • if only $from/$to is specified and it has time in it, then instead of date range filter to exact match ignoring seconds (because display format is missing seconds, but in DB we still record them)
      5. confirm that: - 0.5h
        • specifying one of from/to date only (no time) it works as before: range filter for given day
        • specifying one of from/to date with time it works by showing all records with that time (ignoring seconds)
        • specifying both from & to dates with time would show exactly that range of dates (ignoring seconds)
        • date & time entered in both output & input formats are recognized
      6. review connected task comments & commit

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Erik Snarski [Intechnic]
                Reviewer:
                Gleb Sinkovskiy [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4h
                  4h
                  Remaining:
                  Time Spent - 3h 40m Remaining Estimate - 20m
                  20m
                  Logged:
                  Time Spent - 3h 40m Remaining Estimate - 20m
                  3h 40m