Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Calendar Date Picker

34 views
Skip to first unread message

S.C. Justice

unread,
Aug 12, 2014, 2:03:22 PM8/12/14
to toscawidge...@googlegroups.com
Hello,

I have a simple form that is using the CalendarDatePicker. I don't care whether it is from tw2.forms or tw2.dynforms, but both are giving me issues on my windows 8 machine. The tw2.forms version simply does not work (the same code works fine on my linux machine). The dynforms version has wildly different format between the linux machine and the windows machine. On Linux it provides a dd/mm/yyyy, but on windows it's yyyy/mm/dd. I can't seem to find that the dynforms version has a parameter to set a format for the date, or figure out why the forms version isn't working when the button is clicked on.

Any help or pointers, or links to the appropriate documentation would be greatly appreciated.  For reference the widget code is below.

Thank you,

Sam Justice



class DayPlanForm(twd.CustomisedTableForm):
    title = "Recipe"
    date = twd.CalendarDatePicker
    recipes = RecipeSelectField(options=[('0', "-"*5)])
    action = "/add_to_plan"


Moritz Schlarb

unread,
Aug 12, 2014, 4:33:10 PM8/12/14
to toscawidge...@googlegroups.com
Hi Sam,

are you sure that you are using the most up-to-date versions of tw2.core
and tw2.forms?
I thought we had cleaned up that mess and use the ISO 8601-inspired
format string everywhere (now).

From reading the tw2.dynforms source, I think that you need to set the
format string on the validator, not on the widget itself.
In tw2.forms we do it exactly the other way around...

(I actually planned on discarding on of the two implementations because
it makes so little sense to have both of them with subtle differences.)

For debugging the broken tw2.forms version, try opening the web
developer console in your webbrowser and look for javascript error
and/or url loading errors.

Feel free to post your findings here if you need help then!
Make sure to state what versions you are currently using (e.g. what "pip
freeze" is saying).

Regards,
Moritz
> --
> You received this message because you are subscribed to the Google
> Groups "ToscaWidgets-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to toscawidgets-dis...@googlegroups.com
> <mailto:toscawidgets-dis...@googlegroups.com>.
> To post to this group, send email to
> toscawidge...@googlegroups.com
> <mailto:toscawidge...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/toscawidgets-discuss.
> For more options, visit https://groups.google.com/d/optout.

--
Moritz Schlarb

S.C. Justice

unread,
Aug 13, 2014, 4:06:16 AM8/13/14
to toscawidge...@googlegroups.com
Moritz,

Thanks for the help, I figured that out a little bit earlier today after digging through the source. I did indeed have a (slightly) older version on my development platform than what was installed on my testing machine. Apparently one of the versions was accepting the date formatting and the other wasn't. Not sure what is going on with tw2.forms version since I got tw2.dynforms version working working.

- Sam Justice


To unsubscribe from this group and stop receiving emails from it, send an email to toscawidgets-dis...@googlegroups.com.
To post to this group, send email to toscawidge...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages