Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dateTimePicker min/maxDate types are not all supported or wrongly documented #1020

Open
jepsar opened this issue Oct 20, 2018 · 6 comments
Open
Assignees
Milestone

Comments

@jepsar
Copy link
Contributor

jepsar commented Oct 20, 2018

See https://stackoverflow.com/questions/52863344/bootsfaces-typeerror-mindate-could-not-parse-date-parameter

@geopossachs
Copy link
Collaborator

geopossachs commented May 18, 2019

This will be work:

<b:dateTimePicker value="startdate" required="true" minDate="now" colMd="one-fourth" labelColMd="1" label="Start" format="DD-MM-YYYY" />

the datepicker comes, i belive, from https://github.com/Eonasdan/bootstrap-datetimepicker/blob/master/src/js/bootstrap-datetimepicker.js and has the fix string now inside or parse the string with moment.js
(The secound fix keyword moment will not work 👎 )

When creating a moment from a string, we first check if the string matches known ISO 8601 formats, we then check if the string matches the RFC 2822 Date time format before dropping to the fall back of new Date(string) if a known format is not found.
https://momentjs.com/docs/#/parsing/

This will be not work:

<b:dateTimePicker value="startdate" required="true" minDate="#{now}" colMd="one-fourth" labelColMd="1" label="Start" format="DD-MM-YYYY" />
``
-> the Java EL convert {#now} on server side before with a _wrong_ format

@stephanrauh
Copy link
Collaborator

I've dropped #{now} because it collides with a bean with the same name in OmniFaces (and their #{now} is both documented and configurable).

@geopossachs geopossachs self-assigned this Nov 24, 2019
geopossachs added a commit to geopossachs/BootsFaces-OSP that referenced this issue May 1, 2020
@geopossachs
Copy link
Collaborator

It works with .toInstant().toString() or with moment.js strings

                <b:dateTimePicker value="startdate" required="true" colMd="one-fourth" labelColMd="1" label="Start" format="DD-MM-YYYY" >
                    <!-- <f:attribute name="minDate" value="moment(#{session.lastAccessedTime})"/> -->
                    <!-- <f:attribute name="minDate" value="moment()"/> -->
                    <!-- <f:attribute name="minDate" value="now"/> -->
                    <f:attribute name="minDate" value="#{pageBean.currentDate.toInstant().toString()}" /> 
                </b:dateTimePicker>

i add support for Date()

@geopossachs geopossachs added this to the v1.5.0 milestone May 1, 2020
@geopossachs geopossachs added the Solved This ticket has been solved. If it's still open, we're waiting for the user's confirmation. label May 1, 2020
@geopossachs
Copy link
Collaborator

@stephanrauh do we realy support java7 and lower or can i use java8 in my solutions

@geopossachs geopossachs removed the Solved This ticket has been solved. If it's still open, we're waiting for the user's confirmation. label May 1, 2020
@geopossachs
Copy link
Collaborator

@stephanrauh I has changed in the tag lib the type to object but it also set a string. Do I something wrong or miss something?

I have closed the PR #1136 and move the issue to version 1.6.
Can you create a milestone 1.6 and milestone 1.7 for me?

@stephanrauh
Copy link
Collaborator

@TheCoder4eu Would you mind to create a milestone 1.6?

@geopossachs geopossachs modified the milestones: v1.5.0, v1.6.0 May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants