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

Date control to have placeholder hinting to expected format #3617

Closed
avernet opened this issue Jun 11, 2018 · 3 comments
Closed

Date control to have placeholder hinting to expected format #3617

avernet opened this issue Jun 11, 2018 · 3 comments

Comments

@avernet
Copy link
Collaborator

avernet commented Jun 11, 2018

For instance, as in:

preview-full-grafik

+1 from user

@avernet
Copy link
Collaborator Author

avernet commented Jun 13, 2018

  • Not XBL – This is not implemented in XBL (<xbl:binding element="xf|input:xxf-type('xs:date')">), and I imagine that we wouldn't necessarily need to do the switch for this.
  • Possible implementation – Mirroring the current oxf.xforms.format.input.date, we could have a new oxf.xforms.placeholder.input.date property, allowing one to specify the placeholder to use, if any. Similarly, we would also support oxf.xforms.placeholder.input.time.

@avernet
Copy link
Collaborator Author

avernet commented Jun 15, 2018

Since we only support a few possible variations of date and time formats, we wouldn't even need to have property for the placeholder, but could instead infer it based on the current format.

@avernet
Copy link
Collaborator Author

avernet commented Jun 18, 2018

One wrinkle here is that the placeholder needs to be localized. For instance, the placeholder in the above screenshot, "TT.MM.JJJJ", would need to show if the language is German. The thing is that we don't have a system-wide way to store localized resources at the XForms-level. We only have this at the Form Runner-level, and, arguably, this isn't unreasonable.

This brings us back to the idea of using XBL for the date component, as we already do for an xf:input bound to a xs:dateTime (see datetime.xbl).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant