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

feat: [FC-0047] Relative Dates #367

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

PavloNetrebchuk
Copy link
Contributor

@PavloNetrebchuk PavloNetrebchuk commented Jul 18, 2024

Added a switch that enables showing relative dates on the initial calendar screen and the calendar settings screen.
The isRelativeDatesEnabled functionality has been added to improve the readability of dates within the application. When this feature is enabled (default setting), dates within the range of -7 to +7 days from the current date will be displayed in a relative format (e.g., “just now,” “2 days ago”). Dates outside this range will continue to be displayed in the traditional format. This setting can be toggled in the calendar synchronization settings. The feature is enabled by default.

Disabled Enabled
Screenshot 2024-07-18 at 16 07 09 Screenshot 2024-07-18 at 16 06 14
Screenshot 2024-07-18 at 16 08 05 Screenshot 2024-07-18 at 16 07 51
Screenshot 2024-07-18 at 16 08 50 Screenshot 2024-07-18 at 16 09 16

Environment for testing:

API_HOST_URL: 'https://axim-mobile.raccoongang.net'
OAUTH_CLIENT_ID: 'zP3vPz00c8fTRpYjNbVSlA1fxt9LnCxTM4JK1KQ0'

@openedx-webhooks
Copy link

openedx-webhooks commented Jul 18, 2024

Thanks for the pull request, @PavloNetrebchuk!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/openedx-mobile-maintainers. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 18, 2024
@volodymyr-chekyrta volodymyr-chekyrta marked this pull request as ready for review July 23, 2024 11:58
@sdaitzman
Copy link

HI @PavloNetrebchuk, this looks almost all good from the design side. For upcoming dates within the This Week section, relative dates should use the day of the week e.g. "Friday" instead of "in 4 days."

There are a lot of edge cases here, so I did my best to document them in the Figma file below the Dates section: https://www.figma.com/design/iZ56YMjbRMShCCDxqrqRrR/Open-edX-Mobile-App-All-Screens-v2.2?node-id=6703-32751&t=vxtbWParuRUmfgkZ-4

Here are the cases documented there for reference: Sections & date formats (items appear once, in the first case they meet)

  • “Completed” → all completed items
    • Current year: January 1
    • Before/after current year: January 1, 2010
  • “Past due” → items due before the current time
    • Due on yesterday’s date between 12:00AM and 11:59PM: Yesterday
    • Within last 7 days: 3 Days Ago
    • Current year: January 1
    • Before/after current year: January 1, 2010
  • “Today” → items due on the same calendar date i.e. before 11:59:59 PM
    • No date displayed
  • “This Week” → items due within 7*24 hrs from now
    • Due next date between 12:00AM and 11:59PM: Tomorrow
    • Due the same day of the week as today, but a week away: Next Monday
    • Otherwise: Monday
  • “Next week” → items due within 14*24hrs from now
    • January 1
  • “Upcoming” → all remaining items
    • Current year: January 1

@PavloNetrebchuk
Copy link
Contributor Author

PavloNetrebchuk commented Jul 25, 2024

@sdaitzman
Thanks for your feedback. This is how dates are converted now:

  • Jul 1, 2023 -> July 1, 2023
  • Jul 1, 2024 -> July 1
  • Jul 22, 2024 -> 3 days ago
  • Jul 24, 2024 -> Yesterday
  • Jul 25, 2024 -> Today
  • Jul 26, 2024 -> Tomorrow
  • Jul 27, 2024 -> Saturday
  • Aug 1, 2024 -> Next Thursday
  • Aug 2, 2024 -> August 2
  • Aug 2, 2025 -> August 2, 2025

@sdaitzman
Copy link

Hi @PavloNetrebchuk, thank you for making these updates. I think this is all clear from the design side for now.

In the future, I think it's worth coming back to this and reconsidering how we approach dates/examining some edge cases, so I've created a new roadmap issue (#370) to track that future work.

@PavloNetrebchuk PavloNetrebchuk force-pushed the feat/relative_dates branch 2 times, most recently from 2db038d to db4e41f Compare July 30, 2024 15:31
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 30, 2024
…relative_dates

# Conflicts:
#	app/src/main/java/org/openedx/app/di/ScreenModule.kt
#	core/src/main/java/org/openedx/core/extension/StringExt.kt
#	course/src/main/java/org/openedx/course/presentation/videos/CourseVideoViewModel.kt
#	course/src/test/java/org/openedx/course/presentation/outline/CourseOutlineViewModelTest.kt
#	course/src/test/java/org/openedx/course/presentation/videos/CourseVideoViewModelTest.kt
#	dashboard/src/main/java/org/openedx/courses/presentation/AllEnrolledCoursesView.kt
#	dashboard/src/main/java/org/openedx/courses/presentation/DashboardGalleryView.kt
#	dashboard/src/main/java/org/openedx/dashboard/presentation/DashboardListFragment.kt
#	discovery/src/main/java/org/openedx/discovery/presentation/ui/DiscoveryUI.kt
Copy link
Contributor

@k1rill k1rill left a comment

Choose a reason for hiding this comment

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

LGTM!

@volodymyr-chekyrta volodymyr-chekyrta merged commit 4c1a909 into openedx:develop Sep 11, 2024
4 checks passed
@PavloNetrebchuk PavloNetrebchuk deleted the feat/relative_dates branch September 26, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants