Skip to content

Conversation

divyamtayal
Copy link
Member

@divyamtayal divyamtayal commented Nov 30, 2020

Fixes #5796
Fixed #5831

Short description of what this resolves:

Most of the formats passed to general-date are now standardized. There is no need to pass big repeated formats, it there are 3-4 of those. So, format argument should accept certain keywords and resolve them to formats, like {{general-date date 'dd MM YYYY HH:mm (z)'}} should be treated same as {{general-date date 'date-time-long'}}

This will also make changing specific formats easier in future.

If the passed in format is not a known keyword, it'll be treated as literal format. And format will be optional, with the most used format being the default

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Nov 30, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/dktidskba
✅ Preview: https://open-event-frontend-git-date-format-5796.eventyay.now.sh

@lgtm-com
Copy link

lgtm-com bot commented Nov 30, 2020

This pull request introduces 1 alert when merging a843c1d into a5104cc - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@codecov
Copy link

codecov bot commented Nov 30, 2020

Codecov Report

Merging #5828 (d22cff7) into development (a5104cc) will decrease coverage by 0.03%.
The diff coverage is 66.66%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #5828      +/-   ##
===============================================
- Coverage        23.46%   23.42%   -0.04%     
===============================================
  Files              513      511       -2     
  Lines             5477     5472       -5     
  Branches            63       65       +2     
===============================================
- Hits              1285     1282       -3     
+ Misses            4176     4173       -3     
- Partials            16       17       +1     
Impacted Files Coverage Δ
app/controllers/admin/messages/list.js 0.00% <ø> (ø)
app/controllers/admin/sessions/list.js 0.00% <ø> (ø)
app/controllers/admin/users/list.js 0.00% <ø> (ø)
app/controllers/events/view/sessions/list.js 0.00% <ø> (ø)
app/controllers/events/view/tickets/orders/list.js 0.00% <ø> (ø)
app/helpers/general-date.js 70.00% <66.66%> (+3.33%) ⬆️
app/components/tabbed-navigation.js 33.33% <0.00%> (-20.00%) ⬇️
app/components/widgets/forms/link-field.ts 60.00% <0.00%> (-5.22%) ⬇️
app/components/public/session-item.js 14.28% <0.00%> (-3.90%) ⬇️
app/controllers/orders/view.js 6.45% <0.00%> (-0.22%) ⬇️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5104cc...d22cff7. Read the comment docs.

@divyamtayal divyamtayal changed the title Added date formats Change general-date helper format argument Nov 30, 2020
@divyamtayal
Copy link
Member Author

@iamareebjamal I think everything is done now. Pls let me know to change anything

@iamareebjamal
Copy link
Member

Why did you revert the changes from tables?

This reverts commit bb0f17d.
@divyamtayal
Copy link
Member Author

@iamareebjamal Yeah got the mistake. DONE

Copy link
Contributor

@sachinchauhan2889 sachinchauhan2889 left a comment

Choose a reason for hiding this comment

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

checked almost all date and time pages. but not checked admin tables.
looks goood to me.

only one change needed.

timezone not showing.

sa1

expected result
ka 1

options : {
dateFormat: 'D MMM, YYYY h:mm A (z)'
}
cellComponent : 'ui-table/cell/cell-simple-date'
Copy link
Contributor

Choose a reason for hiding this comment

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

Timezone is not showing.

sa1

expected

ka 1

Copy link
Member

Choose a reason for hiding this comment

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

Not needed here

@divyamtayal
Copy link
Member Author

@iamareebjamal Fixed #5831 here itself

@iamareebjamal
Copy link
Member

Strange, babel should have handled it

@divyamtayal
Copy link
Member Author

Strange, babel should have handled it

yeah

@divyamtayal
Copy link
Member Author

divyamtayal commented Dec 3, 2020

@iamareebjamal any more changes in this PR?

@iamareebjamal iamareebjamal changed the title Change general-date helper format argument fix: Change general-date helper format argument Dec 3, 2020
@iamareebjamal iamareebjamal changed the title fix: Change general-date helper format argument chore: Change general-date helper format argument Dec 3, 2020
@auto-label auto-label bot added fix chore and removed fix labels Dec 3, 2020
@iamareebjamal iamareebjamal merged commit f0869d9 into fossasia:development Dec 3, 2020
@divyamtayal divyamtayal deleted the date-format-5796 branch December 10, 2020 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: a.replaceAll is not a function Change general-date helper format argument

3 participants