Skip to content

feat(core): implement datetime formatter pipes #5502

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

Merged
merged 7 commits into from
Jun 9, 2021

Conversation

mikerodonnell89
Copy link
Member

@mikerodonnell89 mikerodonnell89 commented May 26, 2021

fixes #5499

Please provide a brief summary of this pull request.

Introduces 3 new pipes for formatting dates based up on the dates provided to DATE_TIME_FORMATS by the developer.

dateFormatPipe formats dates
dateTimeFormatPipe formats datetimes
dateFromNowPipe can potentially be used to display how much time has passed since a date - this is currently not implemented with the default DATE_TIME_FORMATS/FdDateTimeAdapter but will be easy to add to the adapter when using moment.js or some similar library.

This does introduce a breaking change. Optional fromNow function was added to the DatetimeAdapter abstract class. Because there are no truly "optional" abstract functions, any adapter that implements the DatetimeAdapter will need to implement the fromNow function - however if the developer does not wish to use the fromNow function, in their custom adapter they can simply implement it as fromNow: undefined as I've done here for the default FdDatetimeAdapter

Please check whether the PR fulfills the following requirements

Documentation checklist:

@mikerodonnell89 mikerodonnell89 added the enhancement New feature or request label May 26, 2021
@mikerodonnell89 mikerodonnell89 added this to the Sprint 63- Manchester milestone May 26, 2021
@mikerodonnell89 mikerodonnell89 requested review from EvilAlexei, xandrio and a team May 26, 2021 22:21
@mikerodonnell89 mikerodonnell89 self-assigned this May 26, 2021
@netlify
Copy link

netlify bot commented May 26, 2021

✔️ Deploy Preview for fundamental-ngx ready!

🔨 Explore the source changes: e756716

🔍 Inspect the deploy log: https://app.netlify.com/sites/fundamental-ngx/deploys/60bfd25f1e41330008b0d38d

😎 Browse the preview: https://deploy-preview-5502--fundamental-ngx.netlify.app

@InnaAtanasova InnaAtanasova changed the title feat: (Core) implement datetime formatter pipes feat(core): implement datetime formatter pipes Jun 4, 2021
@droshev
Copy link
Contributor

droshev commented Jun 7, 2021

Closing old PRs - feel free to reopen it if/when needed

@droshev droshev closed this Jun 7, 2021
@mikerodonnell89 mikerodonnell89 requested a review from Betrozov June 7, 2021 18:33
@N1XUS
Copy link
Contributor

N1XUS commented Jun 7, 2021

@mikerodonnell89 please fix Travis CI failing build

@mikerodonnell89 mikerodonnell89 requested a review from N1XUS June 8, 2021 19:09
@mikerodonnell89 mikerodonnell89 merged commit 2cc9152 into main Jun 9, 2021
@mikerodonnell89 mikerodonnell89 deleted the feat/datetime-formatter-pipes branch June 9, 2021 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add date formatting pipes to ngx core that rely on DatetimeAdapter
4 participants