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

Timeline View show No events to show #101

Open
kylehuynh205 opened this issue Jan 15, 2024 · 5 comments
Open

Timeline View show No events to show #101

kylehuynh205 opened this issue Jan 15, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@kylehuynh205
Copy link

About

image

image

To resovlve

  • Find out if there is a way for Timeline viewer is support the ETDF format date: 1783 to 1784
@HyphenHook
Copy link

HyphenHook commented Jan 24, 2024

Solution

PHP doesn't accept the format of 1783 to 1784 so we can use rewrites to format as accordingly

  • Go to View > TimelineJS Solr-based View > Edit
  • Under Fields > Content datasource: Date Created
  • Go to Rewrite Results (Not the one inside the Render settings) and paste the following Twig code:
    • {{ field_edtf_date_created|split(' to ')[0] }}
  • Go back to Fields > Add > Date Created
  • Go to Rewrite Results (Not the one inside the Render settings) and paste the following Twig code:
    • {{ field_edtf_date_created|split(' to ')[1] }}
  • In the TimelineJS View > Format > Settings > Field mappings and ensure that the Start Date is selected as Content datasource: Date Created and the End Date is selected as Content datasource: Date Created (the Date Created field closes to the bottom of the list would be the one that was recently added and should be the one selected as the End Date)

@kylehuynh205
Copy link
Author

Add the fixes to Standard build with the PR: digitalutsc/islandora-lite-site#27

kylehuynh205 added a commit to digitalutsc/islandora-lite-site that referenced this issue Feb 6, 2024
@kylehuynh205
Copy link
Author

kylehuynh205 commented Feb 26, 2024

@HyphenHook , There is similar issue: https://gundagunde.digital.utsc.utoronto.ca/collection/1/timeline

image

Extend the solution (from " to ") for "Until"

@HyphenHook
Copy link

Extension

  • Replace {{ field_edtf_date_created|split(' to ')[0] }} in rewrite to {{ field_edtf_date_created|replace({' to ': '@', ' until ': '@'})|split('@')[0] }} (In the first date field)
  • Replace {{ field_edtf_date_created|split(' to ')[1] }} in rewrite to {{ field_edtf_date_created|replace({' to ': '@', ' until ': '@'})|split('@')[1] }} (In the second date field)

@HyphenHook
Copy link

HyphenHook commented Apr 17, 2024

Additional issues arise as more metadata with dates that are not properly formatted appear.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Review
Development

No branches or pull requests

2 participants