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

Expose djangoDatetimePicker as jQuery method #65

Merged
merged 2 commits into from
Dec 1, 2021

Conversation

sterliakov
Copy link
Contributor

PR Description

Simplify initialization of dynamically created inputs with jQuery convenience method.

Purpose

Added delayed initialization of pickers. It's useful when new inputs are added dynamically (fetched from ajax or created during DOM manipulation, for instance).

Approach

In current state we can only do jQuery.getScript(...) or copy code by hands. The former is really not convenient and requires additional http request and having static url somewhere in js code, the latter breaks DRY principle. This PR creates jQuery method djangoDatetimePicker which can be later called on input. Options parameter can be used to add options without manipulations with dp_config attribute and have higher priority (allows override).

Issues solved in this PR

What has Changed

  • Created jQuery.djangoDatetimePicker(options) method

@monim67
Copy link
Owner

monim67 commented Nov 29, 2021

Thanks for the PR. Make set the indentation of the file to 2 spaces and submit the PR against 3.x branch.

@sterliakov sterliakov changed the base branch from master to 3.x November 30, 2021 10:32
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1523952055

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.808%

Totals Coverage Status
Change from base Build 924768809: 0.0%
Covered Lines: 160
Relevant Lines: 167

💛 - Coveralls

@monim67 monim67 merged commit b52c2a6 into monim67:3.x Dec 1, 2021
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 this pull request may close these issues.

3 participants