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 and Datetime field not show calendar #481

Closed
gibosler opened this issue Feb 8, 2016 · 24 comments
Closed

Date and Datetime field not show calendar #481

gibosler opened this issue Feb 8, 2016 · 24 comments

Comments

@gibosler
Copy link

gibosler commented Feb 8, 2016

Django 1.9.2 but i've tried to downgrade, i've the same issue.
On DateField i can see the "today" link and the calendar ICON but on click not show calendar.
I've tryed with and without Suit widget with the same result. Disabling suit it works normally.

image

image

The html is loaded correectly but the JS is not "clickable" on the icon. if i call openCalendar() it works.
image

@darklow
Copy link
Owner

darklow commented Feb 8, 2016

To what Django version you tried downgrading?

@gibosler
Copy link
Author

gibosler commented Feb 8, 2016

1.7.9 or 1.8

@ghost
Copy link

ghost commented Feb 20, 2016

Confirm this bug with Django 1.9.2 and Suit 0.2.16

Best regards

@jamescw
Copy link

jamescw commented Feb 24, 2016

Having the same issue site wide after upgrading to Django 1.9

@martinjobb
Copy link

Happens to me too (Django 1.9.2 and Suit 0.2.16)

@tirnovali
Copy link

Same problem (Django 1.9.2 and Suit 0.2.16)

@dimddev
Copy link

dimddev commented Mar 2, 2016

I got the same problem with these versions:
Django==1.9.3
django-suit==0.2.17

@darklow darklow closed this as completed in b5ee3d3 Mar 3, 2016
darklow added a commit that referenced this issue Mar 3, 2016
@darklow
Copy link
Owner

darklow commented Mar 3, 2016

Just released new 0.2.18 version with fixes for this issue

pip install -U django-suit

@tirnovali
Copy link

just make pip update and collectstatic however calendar icon not shown already

@darklow
Copy link
Owner

darklow commented Mar 3, 2016

Can anyone else give some feedback?
I tested it on Django 1.9.1 and 1.9.3 versions and it works for me.
@tirnovali By inspect - do you see extra css added for .date-icon, .clock-icon classes?

@parijathakumar
Copy link

Problem is solved for me. I am on django 1.9.3 and suit 0.2.18. Thank you.

@ghost
Copy link

ghost commented Mar 3, 2016

Now work fine:
Django==1.9.3
django-suit==0.2.18

Thanks

@darklow
Copy link
Owner

darklow commented Mar 4, 2016

@tirnovali Others are reporting it working too.
Please try hard reload, maybe browser cache issue.

@tirnovali
Copy link

@darklow store my static files at S3 and the versions are
Django==1.9.3
django-suit==0.2.18

but the calendar icons not shown

@darklow
Copy link
Owner

darklow commented Mar 4, 2016

@tirnovali

  1. Do you use SuitDateWidgets or original django admin dates widgets?
  2. Open Chrome Dev Console > Network and select Disable Cache and try again
  3. Try using on local Debug=True and Django built in ./manage.py runserver then you'll be sure it is not collectstatic or s3 related caching problem.
  4. By CSS inspect - do you see extra css added for .date-icon, .clock-icon classes?

@leench
Copy link

leench commented Apr 9, 2016

@darklow
in ./manage.py runserver
User original django admin dates widgets.
Disabled Cache.

Django==1.9.5
django-suit==0.2.18

In suit.css file, I can found .date-icon and .clock-icon classes.
but in CSS inspect, I can not found them.

suit

@darklow
Copy link
Owner

darklow commented Apr 9, 2016

@leench What is your question or statement?
Please post also how do you use this field: in admin.py or inlines etc.
admin.py definition would be best.

@leench
Copy link

leench commented Apr 9, 2016

@darklow
Same as top problem, do not show date and clock icon.

field:
pub_date = models.DateTimeField(_('pub date'))

admin.py doing nothing:

class ArticleAdmin(admin.ModelAdmin):
    pass

admin.site.register(Article, ArticleAdmin)

@jerzyk
Copy link

jerzyk commented May 7, 2016

django 1.9 to 1.9.6, plain installation with just only django-suit - no changes to config/setting - shows no icon (like first picture on initial ticket) 1.8.13 - shows calendar/clock icon

this is with no change to admin (original admin widgets)

@jerzyk
Copy link

jerzyk commented May 7, 2016

maybe small addition to the docs? mokeypatching admin - add this to __init__.py to your 'main' project module:

import suit.widgets
from django import forms
from django.contrib.admin.options import FORMFIELD_FOR_DBFIELD_DEFAULTS
from django.db import models

FORMFIELD_FOR_DBFIELD_DEFAULTS.update({
    models.DateTimeField: {
        'form_class': forms.SplitDateTimeField,
        'widget': suit.widgets.SuitSplitDateTimeWidget
    },
    models.DateField: {'widget': suit.widgets.SuitDateWidget},
    models.TimeField: {'widget': suit.widgets.SuitTimeWidget},
})

@tiagovaz
Copy link

I can confirm that using the code above from @jerzyk was the only way to get the widget working here.

django-suit 0.2.18
django 1.9.6

@DjThopson
Copy link

Well im have Django 1.9.8 and Suit 0.2.21 and dont works, someone suggestion?
Thanks

@djangoat
Copy link

FYI I can confirm same effect - no widgets on date/time fields.

When I apply the jerzky/May 7 monkeypatch they are there. Good for now.

Django==1.10.2
django-suit==0.2.21

Thanks!

@DjThopson
Copy link

DjThopson commented Dec 9, 2016

Well finally i finished the repair the bug:

I overwrite the DateTimeShortcuts.js archive into ... /env/lib/python3.4/site-packages/django/contrib/admin/static/admin/js/admin/ in the line 221.

old:
quickElement(
'span', cal_link, '',
'class', 'date-icon',
'title', gettext('Choose a Date')
);
new:
quickElement(
'img', cal_link, '',
'src', '/static/admin/img/icon_calendar.gif',
'alt', gettext('Calendario')
);

That works for me with Django 1.9.8 and Suit 0.2.21.

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