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

Option 'format' doesn't seem to work #68

Open
melwil opened this issue Mar 12, 2015 · 5 comments
Open

Option 'format' doesn't seem to work #68

melwil opened this issue Mar 12, 2015 · 5 comments

Comments

@melwil
Copy link

melwil commented Mar 12, 2015

As I understand the format option, it decides what the widget will fill into the field?

Currently it fills out 'yyyy-mm-dd hh:mm:ss', and no matter what I fill into format will change this.

Additionally README.md says the default behavior does not include seconds, but it does.

@Grokzen
Copy link

Grokzen commented Mar 17, 2015

I have noticed the same thing. It renders the value but it have no effect once some datetime have been chosen.

@asaglimbeni
Copy link
Owner

Hi,
are you sure that you didn't enable the usel10n?
If you add 'format' into options and in the same time set usel10n as True the first one is ignored.
Let me know.

@Grokzen
Copy link

Grokzen commented Mar 19, 2015

@asaglimbeni Installation section of the README says Set USE_L10N = True, USE_TZ = True and USE_I18N = True in settings.py and that is what i did :] So you mean if i set it to False it will start to use format ? Also is this in the docs that it behaves this way? If not it could be a improvment to add.

@asaglimbeni
Copy link
Owner

It is already reported in the documentation at the end of the basc configuration:
https://github.com/asaglimbeni/django-datetime-widget#basic-configuration
the example configuration is only an example! your implementation could change depending on your needs.

@bemall
Copy link

bemall commented Apr 7, 2015

I have format set as 'format': 'MM dd, hh:ii P, yyyy', which results in the date and time being displayed as say "April 05, 09:30 AM 2015". This format works but I get the error "Enter a valid date/time." How can I correct this? @asaglimbeni

Also, how do I disable date and time selection such that a user is not able to select a time that is in the past or unable to select a time that is at least greater than say current time plus two hours ?

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

No branches or pull requests

4 participants