[Toaster] questions about 6040: build date picker

Barros Pena, Belen belen.barros.pena at intel.com
Tue Apr 8 11:04:24 PDT 2014


On 08/04/2014 16:10, "Reyna, David" <david.reyna at windriver.com> wrote:

>Hi Belén,
>
>> Have you updated the paths to the images in the jqueryUI css file?
>
>Ah, I did not do that magic yet.

Hopefully that'll do the trick

>
>> I am not sure I understand why we can accept dd/mm/yy and mm/dd/yyyy but
>> not dd/mm/yyyy or mm/dd/yy
>
>My regex can find where the 4 digits year is, but not between the "mm/dd"
>and "dd/mm", so I have selected what I think is a minimal but unique set
>I can parse against:
>
>  * dd/mm/yy   regex=8 chars       (build page display, short European)
>  * mm/dd/yyyy regex=year at end   (full American, datepicker)
>  * yyyy/mm/dd regex=year at front (django filter native)
>
>What gets weird is as you manually enter the short European format, the
>datepicker (which is still hovering) is trying to match that for you to
>its calendar, but insists on "mm/dd/yy" interpretation so it jumps to the
>wrong month as you enter the day.

Right, that behaviour actually kind of clear things up. As I mentioned
before, since we cannot offer users the ability to select their preferred
date format, we should be aiming for consistency. Since we are using
dd/mm/yy everywhere, that's what the calendar widget should take, although
we should aim to be flexible when it comes to the year, accepting both 2
and 4 digit versions. So I think the picker should take:

* dd/mm/yy and
* dd/mm/yyyy

No harm in accepting yyyy/mm/dd too, I guess, since we need it for the
filters, but I wouldn't really advertise this: let the date highlight
interaction provided by the widget do its job if someone decides to type
their date in that format. Help text saying 'dd/mm/yyyy' is probably
enough.

If users try to type the date manually using mm/dd/yy at least they will
get feedback from the widget, which highlights the date understood.

I hope this makes sense.

Cheers

Belén



>
>There seems to be ways to tell datepicker what format to use (e.g.
>"$.datepicker.formatDate( "yy-mm-dd")" ) but when I tried them datepicker
>just failed so I am doing something wrong.
>
>- David
>
>> -----Original Message-----
>> From: Barros Pena, Belen [mailto:belen.barros.pena at intel.com]
>> Sent: Tuesday, April 08, 2014 2:15 AM
>> To: Reyna, David; DAMIAN, ALEXANDRU
>> Cc: toaster at yoctoproject.org
>> Subject: Re: questions about 6040: build date picker
>>
>> On 07/04/2014 19:02, "Reyna, David" <david.reyna at windriver.com> wrote:
>>
>> >>> I however find that the month forward and back buttons are invisible
>> >> I think we are missing some image files.
>> >
>> >No, does not work. The image files are now there but the buttons are
>> >still invisible.
>>
>> Have you updated the paths to the images in the jqueryUI css file?
>>
>> >
>> >> dd/mm/yy
>> >> mm/dd/yy
>> >
>> >How can I tell between these two when the day of month is <= 12??
>>
>> I guess you can't
>>
>> >
>> >Since the build page is locked to display
>>"{{build.started_on|date:"d/m/y
>> >H:i"}}", I think that I can only accept for manual entry:
>> >
>> >  * dd/mm/yy   (build page display, short European)
>> >  * mm/dd/yyyy (full American, datepicker)
>> >  * yyyy/mm/dd (django filter native)
>>
>> I am not sure I understand why we can accept dd/mm/yy and mm/dd/yyyy but
>> not dd/mm/yyyy or mm/dd/yy
>>
>> >
>> >I did add advisory text to the filter on the accepted formats, so that
>>it
>> >is clear what would work.
>>
>> That should help.
>>
>> Belén
>>
>> >
>> >- David
>> >
>> >> -----Original Message-----
>> >> From: Barros Pena, Belen [mailto:belen.barros.pena at intel.com]
>> >> Sent: Monday, April 07, 2014 4:32 AM
>> >> To: Reyna, David; DAMIAN, ALEXANDRU
>> >> Cc: toaster at yoctoproject.org
>> >> Subject: Re: questions about 6040: build date picker
>> >>
>> >>
>> >>
>> >> On 07/04/2014 06:04, "Reyna, David" <david.reyna at windriver.com>
>>wrote:
>> >>
>> >> >Hi Belen,
>> >> >
>> >> >I have a preliminary implementation for 6040 which adds support for
>> >> >selecting a date range for build started and build completed, a
>>feature
>> >> >my group agrees is very important.
>> >> >
>> >> >My preliminary commit is here (rebased as of Friday night) :
>> >> >dreyna/build_datepicker_6040
>> >> >
>> >> >I have some questions and issues though:
>> >> >
>> >> >1) I enabled the ³datepicker² Javascript by including
>>³jquery-ui.js² in
>> >> >³build.html². However this file is some 400k in size, which seems
>> >> >excessive especially for a home page. Do we want to extract the
>> >> >³datepicker² et. al. scripts into a smaller file?
>> >>
>> >> You can customise your download of jqueryUI to include only the
>>widgets
>> >> you need.
>> >>
>> >> http://jqueryui.com/download/
>> >>
>> >> I am not sure what we exactly need for the datepicker widget: the
>>Core
>> >>for
>> >> sure, but we might also need the Effects Core for transitions.
>> >>
>> >> >
>> >> >2) I copied and added the Œjquery-ui-1.10.3.custom.min.css¹ from
>>your
>> >> >Toaster website so that the background colors for the datapicker
>>would
>> >>be
>> >> >valid. I however find that the month forward and back buttons are
>> >> >invisible. Do you know what CSS we need to
>> >> > adjust to get them visible again?
>> >>
>> >> I think we are missing some image files. It's probably better if you
>> >> download the theme from the jqueryUI website (same link as above):
>>that
>> >> will bring in all image files as well. You will find them in
>> >>
>> >> jquery-ui-1.10.4.custom/css/ui-lightness/images
>> >>
>> >> From all those there, I think we need the following ones:
>> >>
>> >> ui-bg_gloss-wave_35_f6a828_500x100.png
>> >> ui-icons_228ef1_256x240.png
>> >> ui-icons_222222_256x240.png
>> >> ui-icons_ef8c08_256x240.png
>> >> ui-icons_ffd27a_256x240.png
>> >> ui-icons_ffffff_256x240.png
>> >>
>> >> You will need to move them with all other image files in Toaster to
>> >>
>> >> poky/bitbake/lit/toaster/toastergui/static/img
>> >>
>> >> You will then probably need to modify the jquery-ui-1.10.4.custom.css
>> >>(or
>> >> min.css) and update the path to the images.
>> >>
>> >> >
>> >> >3) We have a multitude of date formats, and I image that they change
>> >>for
>> >> >Europe.
>> >> >
>> >> >  (a) The build page shows in my page ³dd/mm/yy²
>> >> >  (b) The filters want ³yyyy-mm-dd²
>> >> >  (c)  The datepicker returns ³mm/dd/yyyy²
>> >>
>> >> Ideally we would have some Toaster settings where people could select
>> >> their date format. Unfortunately, we don't right now and we won't
>>have
>> >> those for 1.6, so we should be aiming for consistency. So far, all
>>date
>> >> formats shown in Toaster (except for the Recent builds section) use
>> >> dd/mm/yy (although it is probably ok to use dd/mm/yyyy in the date
>> >>picker
>> >> for clarity). I think you can set the datepicker date format:
>> >>
>> >> http://api.jqueryui.com/datepicker/#option-dateFormat
>> >>
>> >> >
>> >> >I have enabled the code to convert ³mm/dd/yyyy² and ³yyyy/mm/dd²
>> >> >internally to ³yyyy-mm-dd² for the filter (and illegal date formats
>>are
>> >> >converted to Œtoday¹).
>> >>
>> >> This is good thinking, thanks.
>> >>
>> >> >
>> >> >I am concerned however that we allow users to directly edit the date
>> >> >fields, and especially that they might think that the build tables
>>date
>> >> >field (³dd/mm/yy²) is expected. Should I add that as a supported
>> >>format?
>> >> >Is it different for Europe??
>> >>
>> >> Ideally, we would accept all 4 as follows:
>> >>
>> >> dd/mm/yyyy
>> >> dd/mm/yy
>> >> mm/dd/yyyy
>> >> mm/dd/yy
>> >>
>> >> So users can type a date in any of the 4 formats above. The widget is
>> >> quite smart and accepts only numbers and / characters, so we should
>>be
>> >> safe when it comes to separators.
>> >>
>> >> >
>> >> >4) I am finding that the backend is not processing my composite date
>> >> >ranges as expected. I get it to work for ³yesterday², which is for
>> >> >example
>> >> >³filter=completed_on__gte;completed_on__lt:2014-04-05;2014-04-06²,
>>but
>> >> >other ranges return the wrong set.
>> >> >
>> >> >
>> >> >For example,
>> >> >³filter=completed_on__gte;completed_on__lt:2014-03-01;2014-03-02²
>> >>returns
>> >> >all of my April builds.
>> >> >
>> >> >I am not sure how tested ³_get_filtering_query² is for these
>>extended
>> >> >formats, or maybe I am not using it correctly. That is perhaps a
>> >>question
>> >> >for Alex? Could you ping him?
>> >> >
>> >> >- David
>> >> >
>> >> >
>> >>
>> >
>>
>



More information about the toaster mailing list