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

Add the datetime extension #289

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add the datetime extension #289

wants to merge 1 commit into from

Conversation

mwouts
Copy link
Owner

@mwouts mwouts commented Jun 10, 2024

Will close #288

Copy link

Thank you for making this pull request.

Did you know? You can try it on Binder: Binder:lab.

Also, the version of ITables developed in this PR can be installed with pip:

pip install git+https://github.com/mwouts/itables.git@add_datetime_extension

(this requires nodejs, see more at Developing ITables)

required by SearchBuilder when displaying dates
@@ -20,6 +20,9 @@ import 'datatables.net-keytable-dt/css/keyTable.dataTables.min.css';
import 'datatables.net-rowgroup-dt';
import 'datatables.net-rowgroup-dt/css/rowGroup.dataTables.min.css';

import DateTime from 'datatables.net-datetime';
import 'datatables.net-datetime/dist/dataTables.dateTime.min.css';
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AllanJard for the other extensions I usually find the .css file in a css folder, does it have to be different for this one?

@mwouts
Copy link
Owner Author

mwouts commented Jun 24, 2024

Testing locally with this code almost works, e.g. we can display and filter the table

from itables import show, init_notebook_mode

init_notebook_mode(all_interactive=True)

show(pd.DataFrame({'date':pd.date_range("2022-01-01", "2024-12-31")}), buttons=["searchBuilder"])

@AllanJard do I need to do something special to get rid of the YYYY before the date?

image

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.

SearchBuilder Requires DateTime when used with dates.
2 participants