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

Respect user's locale when rendering the date range in the repo activity page #21410

Merged
merged 7 commits into from
Oct 12, 2022
Merged

Respect user's locale when rendering the date range in the repo activity page #21410

merged 7 commits into from
Oct 12, 2022

Commits on Oct 12, 2022

  1. Respect user's locale when rendering the date range in the repo activ…

    …ity page
    
    Previously, to make the date range understood by all, we used the format "2006-01-02" for the dates as it's locale-generic.
    
    This commit changes the rendering logic. Instead of rendering the date on the server, we send a formatted computer-readable timestamp. The client's javascript then renders it according to the user's locale.
    
    This approach is reusable across the codebase, any <time></time> tag with the "data-format-text-according-to-datetime" attribute would get rendered according to the user's chosen locale.
    
    Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
    yardenshoham committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    cf1b23c View commit details
    Browse the repository at this point in the history
  2. Rename data-format-text-according-to-datetime to data-date-format

    Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
    yardenshoham committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    c964835 View commit details
    Browse the repository at this point in the history
  3. Update web_src/js/features/formatting.js

    Co-authored-by: silverwind <me@silverwind.io>
    yardenshoham and silverwind committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    f777fac View commit details
    Browse the repository at this point in the history
  4. Use string instead of boolean value in time tag locale automation

    Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
    yardenshoham committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    a22b21b View commit details
    Browse the repository at this point in the history
  5. Refactor formatting.js to reorder formatter initialization

    Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
    yardenshoham committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    dd76642 View commit details
    Browse the repository at this point in the history
  6. Update templates/repo/activity.tmpl

    Co-authored-by: silverwind <me@silverwind.io>
    yardenshoham and silverwind authored Oct 12, 2022
    Configuration menu
    Copy the full SHA
    733739d View commit details
    Browse the repository at this point in the history
  7. Update web_src/js/features/formatting.js

    Co-authored-by: silverwind <me@silverwind.io>
    yardenshoham and silverwind authored Oct 12, 2022
    Configuration menu
    Copy the full SHA
    da91763 View commit details
    Browse the repository at this point in the history