https://oss.sonatype.org/content/repositories/snapshots/



<groupId>com.trsvax</groupId>

<artifactId>tapestry-datepicker</artifactId>

<version>0.0.1-SNAPSHOT</version>


It's still a work in progress but I think it's starting to come together.
Being able to pass attributes from the translator into the html stream is
proving useful. For example you can do things such as

placeholder="mm-dd-yyyy"




On Tue, Oct 8, 2013 at 4:33 AM, Geoff Callender <
[email protected]> wrote:

> What's the artifact info?
>
> On 07/10/2013, at 10:26 PM, Barry Books wrote:
>
> > Snapshot 0.0.1-SNAPSHOT is available at
> >
> >
> > https://oss.sonatype.org/content/repositories/snapshots/
> >
> > I have a bit of cleanup and then I'll push a version to maven central
> >
> >
> >
> > On Fri, Oct 4, 2013 at 3:33 PM, Barry Books <[email protected]> wrote:
> >
> >> After much googling I think I've added iPhone type="date" support. I had
> >> to make a few assumptions to get it to work.
> >>
> >> 1. The format for type="date" support is yyyy-mm-dd. This is what the
> >> iPhone appears to use and seems a reasonable choice.
> >> 2. The best test I could find to indicate native support is
> >>
> >> *var* input = document.createElement('input');
> >>
> >> input.setAttribute('type', 'date');
> >>
> >> input.value = 'testing';
> >>
> >>
> >> If the type is date and the value is not testing I'm assuming native
> date
> >> support.
> >>
> >>
> >> What I ended up doing was adding a hidden element to support native date
> >> pickers. If I think there is support I hide the real one and turn the
> >> hidden one into a date. On a form submit I copy the data into the real
> >> element. This way I can support both date formats. It seems to work on
> my
> >> iPhone but that's not a large sample.
> >>
> >>
> >> There is still work to be done but I think I should be able to meet all
> >> the requirements I've seen so far.
> >>
> >>
> >>
> >>
> >>
> >> On Thu, Oct 3, 2013 at 9:15 PM, Barry Books <[email protected]> wrote:
> >>
> >>> Unfortunately modernizer does not really support that. From the docs
> >>>
> >>> Modernizr cannot detect that date inputs create a datepicker,
> >>>
> >>> It is possible to detect if a browser support type="date" but that does
> >>> not mean it has a datepicker. I suspect I'm going to add an option to
> give
> >>> it a try.
> >>>
> >>>
> >>> On Thu, Oct 3, 2013 at 8:12 PM, Geoff Callender <
> >>> [email protected]> wrote:
> >>>
> >>>> Sounds good, Barry.
> >>>>
> >>>> You mentioned earlier that you were "planing on using modernizr to
> detect
> >>>> if type="date" is supported. " so that browsers with good HTML5 date
> >>>> support (eg. iOS Safari, Chrome) are left alone. How did that go?
> >>>>
> >>>>
> >>>> On 3 October 2013 12:08, Barry Books <[email protected]> wrote:
> >>>>
> >>>>> I've uploaded the initial version to github
> >>>>>
> >>>>> https://github.com/trsvax/tapestry-datepicker
> >>>>>
> >>>>> I think I'm going to make this standalone project that only contains
> >>>> the
> >>>>> datepicker. This will make it easier for other project to just
> include
> >>>> it.
> >>>>> Currently to use it you will have to download and build it.  Here is
> an
> >>>>> example usage
> >>>>>
> >>>>> <t:form>
> >>>>>    <t:textfield value="date" t:mixins="datefield/JQueryDatePicker"
> >>>>> data-duration="slow"/>
> >>>>>    <input type="submit"/>
> >>>>>  </t:form>
> >>>>>
> >>>>>
> >>>>> All that's required is the input type be a date which causes Tapestry
> >>>> to
> >>>>> use a Date Translator to convert the data to/from a string. This also
> >>>>> creates the client side validation. The mixin adds the client side
> >>>>> interface. In this case the JQuery UI calendar.
> >>>>>
> >>>>> If you prefer you can create your own component and override the
> >>>> Tapestry
> >>>>> one.
> >>>>>
> >>>>> public class DateField extends TextField {
> >>>>>
> >>>>>    @Mixin
> >>>>>    private JQueryDatePIcker mixin;
> >>>>>
> >>>>> }
> >>>>>
> >>>>> Questions, commets etc are welcome
> >>>>>
> >>>>> Barry
> >>>>>
> >>>>
> >>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to