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

Publish in future time doesn't work #129

Open
danblah opened this issue Oct 18, 2021 · 9 comments
Open

Publish in future time doesn't work #129

danblah opened this issue Oct 18, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@danblah
Copy link

danblah commented Oct 18, 2021

Entering in date works and as soon as you move away it clears

@danblah danblah added the bug Something isn't working label Oct 18, 2021
@frjo
Copy link

frjo commented Oct 19, 2021

This seems to be a wagtail bug. The jQuery date picker that wagtail uses clash with the browsers built in one.

@frjo
Copy link

frjo commented Oct 19, 2021

@Parbhat Any ideas here?

@Parbhat
Copy link

Parbhat commented Oct 19, 2021

@frjo Yeah looks like a Wagtail bug. Also can not find the fix in the latest releases. We should report it to the Wagtail repo.

@frjo
Copy link

frjo commented Oct 19, 2021

@Parbhat Thanks, I will report it.

@frjo
Copy link

frjo commented Oct 19, 2021

wagtail/wagtail#7632

@frjo
Copy link

frjo commented Oct 19, 2021

Turns out to be a Hypha issue. The scheduled publishing date fields use this template hypha/templates/django/forms/widgets/datetime.html. Removing that solves the issue.

@Parbhat Ideas how to fix this in a nice way? Can we make this field use the default template instead?

{'name': 'go_live_at', 'is_hidden': False, 'required': False, 'value': None, 'attrs': {'autocomplete': 'off', 'id': 'id_go_live_at'}, 'template_name': 'wagtailadmin/widgets/datetime_input.html', 'type': 'text', 'config_json': '{"dayOfWeekStart": 0, "format": "Y-m-d H:i", "formatTime": "H:i"}'}

@Parbhat
Copy link

Parbhat commented Oct 19, 2021

@frjo Thanks for looking into it closely. I don't know the context why we are overriding these django widget templates. Can we try to use the overriden templates only where required instead of changing the default template?

@sandeepsajan0
Copy link

sandeepsajan0 commented Oct 29, 2021

@frjo @Parbhat We are using customised django forms widget templates date.html and datetime.html in apply funds, projects(start/end proposing dates) and many other places. And internally, wagtail is also using the django forms widget templates. That's why it is showing both of the designs.

So now we have two cases:

  1. We can use only and same customized template at both the places(in wagtail form, and in django form). It will give us similar design at both of the places.
  2. Or we can use only wagtail widget in wagtail and django widget in django forms(it can be done by overwritting the wagtail widget templates)

Which one looks better to you?

@frjo
Copy link

frjo commented Oct 30, 2021

I think the best is to use standard Wagtail date/datetime widget in Wagtail admin. The custom one we only use in Hypha itself.

That should resolve this bug.

I believe it is a good point to have Wagtail use its defaults as much as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants