constellation icon indicating copy to clipboard operation
constellation copied to clipboard

Import from file - consider updating default date time options to work where leading 0 is missing from day, hour and seconds not present

Open GammaVel opened this issue 1 year ago • 0 comments

Prerequisites

  • [X] Put an X between the brackets on this line if you have done all of the following:

    • Running the latest version of Constellation

    • Attached the Support Package via Help > Support Package

    • Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ

    • Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues

    • Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories

Description

I have been using Constellation to map out ride sharing data which gives me unique insights into the data. I have noticed when I am using the import from file option with a CSV file that has date time information, that the default options that are shown under the date/time don't work with my data. I am required to set up a custom attribute to get it to work.

A sample of my date time data is presented as follows: image

The date/time options are as follows: image

It would be really good if the option for dd/mm/yyyy worked with the values that don't have the zero present by automatically adding in the zero - such as 1/01/2017. This is a fairly standard date value. Similarly, the hours could automatically add in a zero where is it not present. Currently 7:30 will error out for HH:MM and I need to change this to be H:MM or add a leading zero to all of my hour information (this is too time consuming as I have hundreds of records).

If this is not an option, consider making some new defaults so the users get a hint of what formats are needed. As DD/MM/YYYY is a standard date representation I was initially confused on why it wasn't working for me with 1/06/2017 etc.

Steps to Reproduce

  1. Obtain sample CSV file with date and time information saved like this 1/06/2017 2:55

  2. Access the import from file functionality and select Analytic graph as the destination (this has the date/time information)

  3. Select the file for loading

  4. Navigate to the date/time editor and right click to the Date/Time formatter: image

  5. Choose this option as it looks like it could work with my date field: dd/MM/YYYY HH:MM:SS

  6. Apply - this errors out for multiple reasons - some of my dates are missing the leading 0, my time does not have leading 0 and the seconds are missing

  7. Observe the error message that is displayed, it gives me some hints but not too much help

  8. Work out that I need to make a new custom attribute of d/MM/YYYY H:MM for this to work

  9. Apply > now the field mapping for Date time works

**Expected behaviour:**if it is not possible to automatically add in leading 0's where they are missing, consider adding a default that will work in addition to having all the other ones so the users can quickly see a match and not have to make a custom one

Actual behaviour: there is no option to accept a date in the default as d/mm/yyyy. If I use dd/mm/yyyy there is an error for everything that is missing the leading 0. Same issue with hours and second not being present

Reproduces how often: 100%

Additional Information

Two possible solutions here - update the defaults to include a new one that works for days missing the zero, or update the code to add in missing leading zeros.

Thanks for considering my suggestion!

GammaVel avatar Jul 19 '22 02:07 GammaVel