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

Merged
merged 1 commit into from
Sep 8, 2024
Merged

Add the datetime extension #289

merged 1 commit into from
Sep 8, 2024

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)

@@ -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

@mwouts mwouts force-pushed the add_datetime_extension branch from b434c8b to 4e91780 Compare September 3, 2024 21:03
@mwouts mwouts marked this pull request as ready for review September 3, 2024 21:07
@mwouts
Copy link
Owner Author

mwouts commented Sep 3, 2024

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

The problem is gone now with datatables.net-datetime==1.5.3, thank you Allan!

@AllanJard
Copy link

AWesome - good to hear :)

@mwouts mwouts force-pushed the add_datetime_extension branch 3 times, most recently from 7cefe16 to 8abc56a Compare September 7, 2024 23:41
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.88%. Comparing base (014d22e) to head (47847ae).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #289   +/-   ##
=======================================
  Coverage   95.88%   95.88%           
=======================================
  Files          27       27           
  Lines        1191     1191           
=======================================
  Hits         1142     1142           
  Misses         49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mwouts mwouts force-pushed the add_datetime_extension branch from 8abc56a to c4127ec Compare September 8, 2024 19:53
required by SearchBuilder when displaying dates
@mwouts mwouts force-pushed the add_datetime_extension branch from c4127ec to 47847ae Compare September 8, 2024 19:54
@mwouts mwouts merged commit e053256 into main Sep 8, 2024
14 checks passed
@mwouts mwouts deleted the add_datetime_extension branch September 8, 2024 20:02
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.
3 participants