Datepicker not preset with Date in dateValue

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Datepicker not preset with Date in dateValue

opto
Previously dateValue did preset the Date when given a js date(), see MDN. No longer. Is there a workaround? How does lightning do it?

I am already using the new bindings.
Thanks Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

Jörg Knobloch
On 25/12/2018 17:43, opto wrote:
> Previously dateValue did preset the Date when given a js date(), see MDN. No longer. Is there a workaround? How does lightning do it?
>
> I am already using the new bindings.

We forked date picker to c-c. I'm not aware of any (intentional)
changes. Lightning does its own thing, only consumer I know is the "Send
Later" add-on by Jonathan Kamens. I suggest to check its code.

Jörg.

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
Thanks Jörg.

After an evening of reading (I am now in another timezone) and finding that bug already, I just now noticed that the new (?) definition of datepicker is in disagreement to MDN and to previous use of datepicker in the addon I am updating.

MDN: value has a string value of date: YYYY-MM-DD, dateValue has the js Date.
Actual behaviour: value is Date.

Lightning is identical to current behaviour.

So the workaround is to replace dateValue with value.

I will put a note into MDN, the addons 57 document and open a bug so it can be decided which behaviour is wanted.

Thanks,

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

Jörg Knobloch
On 25/12/2018 20:40, opto wrote:
> Actual behaviour: value is Date.

Are you sure? Reading the code, the getter returns YYYY-MM-DD:

https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569

And the setter just below appears to accept this as input.

Jörg.

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
In reply to this post by opto
https://bugzilla.mozilla.org/show_bug.cgi?id=1516360
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
In reply to this post by Jörg Knobloch
Am Dienstag, 25. Dezember 2018 20:50:36 UTC+1 schrieb Jörg Knobloch:

> On 25/12/2018 20:40, opto wrote:
> > Actual behaviour: value is Date.
>
> Are you sure? Reading the code, the getter returns YYYY-MM-DD:
>
> https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569
>
> And the setter just below appears to accept this as input.
>
> Jörg.

I didn't try YYYY- etc. because I have a Date object, but value = Date object definitely works, and dateValue does not.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
In reply to this post by Jörg Knobloch
Am Dienstag, 25. Dezember 2018 20:50:36 UTC+1 schrieb Jörg Knobloch:

> On 25/12/2018 20:40, opto wrote:
> > Actual behaviour: value is Date.
>
> Are you sure? Reading the code, the getter returns YYYY-MM-DD:
>
> https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569
>
> And the setter just below appears to accept this as input.
>
> Jörg.

searchfox is totally different from dxr on esr60:
https://dxr.mozilla.org/comm-esr60/source/calendar/resources/content/datetimepickers/datetimepickers.xml#104
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
Am Dienstag, 25. Dezember 2018 21:18:20 UTC+1 schrieb opto:

> Am Dienstag, 25. Dezember 2018 20:50:36 UTC+1 schrieb Jörg Knobloch:
> > On 25/12/2018 20:40, opto wrote:
> > > Actual behaviour: value is Date.
> >
> > Are you sure? Reading the code, the getter returns YYYY-MM-DD:
> >
> > https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569
> >
> > And the setter just below appears to accept this as input.
> >
> > Jörg.
>
> searchfox is totally different from dxr on esr60:
> https://dxr.mozilla.org/comm-esr60/source/calendar/resources/content/datetimepickers/datetimepickers.xml#104

sorry wrong line number in link
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
In reply to this post by Jörg Knobloch
Am Dienstag, 25. Dezember 2018 20:50:36 UTC+1 schrieb Jörg Knobloch:

> On 25/12/2018 20:40, opto wrote:
> > Actual behaviour: value is Date.
>
> Are you sure? Reading the code, the getter returns YYYY-MM-DD:
>
> https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569
>
> And the setter just below appears to accept this as input.
>
> Jörg.

maybe I somehow link into calendar definition?

searchfox is identical to dxr.
but both files have no dateValue, so there is still something strange compared to MDN.

I will try inJonathan's test addon from the bug
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

Jörg Knobloch
On 25/12/2018 21:24, opto wrote:
> maybe I somehow link into calendar definition?

Right.

https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569

That former M-C datapicker forked to C-C:

Also on DXR and comm-esr60:

https://dxr.mozilla.org/comm-esr60/source/common/bindings/datetimepicker.xml#567

There's also dataValue:

https://dxr.mozilla.org/comm-esr60/source/common/bindings/datetimepicker.xml#105

You pointed to some Calendar stuff I know nothing about. As I said,
they're doing their own thing:

Their value appears to be a date:

https://dxr.mozilla.org/comm-esr60/source/calendar/resources/content/datetimepickers/datetimepickers.xml#92

Jörg.

P.S.: Would you mind closing your bug as invalid before I do ;-) ?

_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
Am Dienstag, 25. Dezember 2018 21:45:22 UTC+1 schrieb Jörg Knobloch:

> On 25/12/2018 21:24, opto wrote:
> > maybe I somehow link into calendar definition?
>
> Right.
>
> https://searchfox.org/comm-central/rev/4c3db8aa97f726068fe1021234575b2edb445af2/common/bindings/datetimepicker.xml#569
>
> That former M-C datapicker forked to C-C:
>
> Also on DXR and comm-esr60:
>
> https://dxr.mozilla.org/comm-esr60/source/common/bindings/datetimepicker.xml#567
>
> There's also dataValue:
>
> https://dxr.mozilla.org/comm-esr60/source/common/bindings/datetimepicker.xml#105
>
> You pointed to some Calendar stuff I know nothing about. As I said,
> they're doing their own thing:
>
> Their value appears to be a date:
>
> https://dxr.mozilla.org/comm-esr60/source/calendar/resources/content/datetimepickers/datetimepickers.xml#92
>
> Jörg.
>
> P.S.: Would you mind closing your bug as invalid before I do ;-) ?

yes - sorry for the confusion. I will reverse the documents.

Amazing that that addon worked with dateValue before TB 45 and does not now - that is the reason for all that hassle. Why does it link into calendar now and did not do before? Or maybe they changed their definition and were identical to base TB before?

Never mind --- many thanks.

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Datepicker not preset with Date in dateValue

opto
even if I remove the calender stuff, it does not pick up dateValue.

Also, it does not show <datepicker type="normal"/>, but only <datepicker type="grid"/>  and <datepicker type="popup"/>

testet in Jonathan Kamens's addon datepicker-reproducer from the bug. I can upload that somewhere if helpful.

<datepicker type = "normal" /> is specified in MDN. I also tried type="" or no type.
No type is what I have in the addon, which I think worked many versions ago.



dateValue is in
 <binding id="datetimepicker-base"
           extends="chrome://global/content/bindings/general.xml#basecontrol">


datepicker-popup extends datetimepicker-base.



Is the extends path  correct, is the MOZ_SUITE definition correct?:

 <binding id="datepicker"
#ifdef MOZ_SUITE
           extends="chrome://communicator/content/bindings/datetimepicker.xml#datetimepicker-base">
#else
           extends="chrome://messenger/content/datetimepicker.xml#datetimepicker-base">
#endif



or why would it not pick up dateValue?

Klaus
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird