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[ATLAS-104]: Introducing Date & Time Module #54

Closed
wants to merge 31 commits into from

Conversation

RgnDunes
Copy link
Collaborator

@RgnDunes RgnDunes commented Jan 18, 2024

Description

This PR adds a new module called Date & Time Module to handle all the validation, parsing, and formatting of Date and Time. This module consists of below api's:

  • add
  • substract
  • formatDate
  • formatDateTime
  • formatTime
  • getQuarter
  • getRelativeTime
  • getWeek
  • getWeekdays
  • isAfter
  • isBefore
  • isLeapYear
  • isSameDay
  • isValidDate
  • parseDateTime

PR for README: #56
PR for UTs: #55

Screenshot 2024-01-23 at 4 47 06 AM

Changes Made

List the main changes made in this pull request.

Title ---
JIRA link https://razorpay.atlassian.net/browse/ATLAS-104
Slack thread (if any) NA
Product spec Date & Time Module - i18nify , Date & Time Usage in Merchant Dashboard
Tech spec/One-pager NA
Bundle Size Difference NA
Fixes Issue NA

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change is a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Is your change backward compatible ?
  • Tested on major browsers (Chrome, Firefox, Safari, IE) ?
  • Tested in a consumer application(s) ?

Additional Notes

Any additional information that would be helpful for the reviewer.

Checklist:

  • Add Jira ID(s) in PR title and in the description?
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My code is written in TypeScript and follows the coding standards of the project.
  • I have added relevant documentation and updated the README if necessary.
  • My commit messages are clear and follow the project's commit message conventions.
  • Is any external library added?
  • My changes do not introduce any new runtime errors or warnings.
  • All relevant unit tests have been added/updated in my PR for the change.
  • Any Screenshots (mobile & desktop) required for PR? If yes, have you added the respective screenshots ?
  • Any manual dev testing done by you on beta/func environment?
  • Reviewer added (SLA 2 days)

Reviewer Checklist

  • Sufficient QA/Dev-Testing is done with proof (test cases list)
  • Ensure that the change in bundle size falls within the acceptable range.

PR Title Format

Format: <type>: <subject>

Types can be as follows:

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Copy link

changeset-bot bot commented Jan 18, 2024

🦋 Changeset detected

Latest commit: e591663

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@razorpay/i18nify-js Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@RgnDunes RgnDunes marked this pull request as draft January 18, 2024 06:55
@RgnDunes RgnDunes changed the title feat: Introducing Date & Time Module feat[ATLAS-104]: Introducing Date & Time Module Jan 18, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2024

Codecov Report

Attention: 64 lines in your changes are missing coverage. Please review.

Comparison is base (5c6b356) 91.11% compared to head (e591663) 85.18%.
Report is 1 commits behind head on master.

Files Patch % Lines
...i18nify-js/src/modules/dateTime/getRelativeTime.ts 69.81% 15 Missing and 1 partial ⚠️
packages/i18nify-js/src/modules/dateTime/index.ts 0.00% 15 Missing ⚠️
.../i18nify-js/src/modules/dateTime/formatDateTime.ts 70.00% 6 Missing ⚠️
...ages/i18nify-js/src/modules/dateTime/formatTime.ts 66.66% 6 Missing ⚠️
...s/i18nify-js/src/modules/dateTime/parseDateTime.ts 81.48% 5 Missing ⚠️
...ages/i18nify-js/src/modules/dateTime/formatDate.ts 77.77% 4 Missing ⚠️
...ges/i18nify-js/src/modules/dateTime/getWeekdays.ts 75.00% 4 Missing ⚠️
...ges/i18nify-js/src/modules/dateTime/isValidDate.ts 88.23% 4 Missing ⚠️
packages/i18nify-js/src/modules/dateTime/utils.ts 90.00% 2 Missing ⚠️
packages/i18nify-js/src/index.ts 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
- Coverage   91.11%   85.18%   -5.93%     
==========================================
  Files          28       49      +21     
  Lines         270      594     +324     
  Branches       64      163      +99     
==========================================
+ Hits          246      506     +260     
- Misses         24       87      +63     
- Partials        0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rzpcibot
Copy link
Contributor

rzpcibot commented Jan 18, 2024

Warnings
⚠️ Your PR has over 600 lines of code additions 😱 . Try to breakup into separate PRs 👍
⚠️

package.json: package.json is modified, do get this reviewed by gatekeepers ! 😇

Bundle Size Report

Files

click to expand/collapse
🟢 No Change 🗑 File Deleted 🆕 New File 📈 Size Increased 👍 Size Reduced
Parsed (kb)
🚦 File Name Base PR Diff %
🟢 cjs/index.js 70.97 70.97 $\textcolor{green}{0}$ 0
🟢 esm/index.js 0.64 0.64 $\textcolor{green}{0}$ 0
🟢 umd/index.js 80.34 80.34 $\textcolor{green}{0}$ 0

Generated by 🚫 dangerJS against e591663

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@RgnDunes RgnDunes marked this pull request as ready for review January 23, 2024 08:49

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@RgnDunes RgnDunes marked this pull request as draft February 8, 2024 09:07

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 727a19f. ± Comparison against base commit efd1f64.

@RgnDunes RgnDunes marked this pull request as ready for review February 14, 2024 07:31
* refactor parseDateTime module

* add readme docs for dateTime module

* restructure README

* updated isValidDate docs

* replace i18nify with i18nify-js

* update README

* [docs]: update README as per the changes in api contracts in dev PR
* add test fils

* add UT for add - dateTime module

* migrate test files

* add UT for formatDate - dateTime module

* add UT for formatDateTime - dateTime module

* fix formatDate

* add UT for formatTime - dateTime module

* add leftout locales date format

* add UT for getQuarter - dateTime module

* add UT for getQuarter - dateTime module

* add UT for getRelativeTime - dateTime module

* add UT for getWeek - dateTime

* add UT for getWeekdays - dateTime

* add UT for isAfter - dateTime

* add UT for isBefore - dateTime

* add UT for isLeapYear - dateTime

* add UT for isSameDay - dateTime

* fix numerals test case

* add date format in stringToDate

* add UT for parseDateTime - dateTime

* add UT for subtract - dateTime

* add UT for stringToDate - utils - dateTime

* comment failing test cases

* remove extra files

* [fix]: fix failing UT

* [fix]: fix failing UT
@RgnDunes RgnDunes marked this pull request as draft February 14, 2024 13:12
@RgnDunes RgnDunes closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants