Skip to content

Feat: Format duration ms to duration #1477

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

Closed
wants to merge 16 commits into from
Closed

Feat: Format duration ms to duration #1477

wants to merge 16 commits into from

Conversation

developerr-ayush
Copy link
Contributor

Open in Gitpod know more

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new JavaScript files are placed inside an existing directory.
  • All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • All new algorithms have a URL in their comments that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@developerr-ayush
Copy link
Contributor Author

  1. hey can you give me hectoberfest label?
  2. do you have any resource for understanding forking if you see above then there are lots of commits visible and that commits are from previous merge request although it doesn't affect but how can I sort this?
  3. i have tried the rebase thing but yet didn't worked.

Thanks

appgurueu
appgurueu previously approved these changes Oct 8, 2023
Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Code is fine, has tests and docs. I'm not sure whether we can consider this algorithmically interesting enough, though. The string formatting logic here is pretty straightforward.

Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Why did you add a msToDuration function here?

@developerr-ayush
Copy link
Contributor Author

@appgurueu it is a related function to the same which converts ms to some other string that's why I have added that here in this pr

@developerr-ayush developerr-ayush changed the title Feat: Format duration ms to words Feat: Format duration ms to duration Oct 9, 2023
@appgurueu
Copy link
Collaborator

I don't really see a point in having two functions around which do similar things.

Still, the main question persists: What does this - algorithmically - teach a reader?

@developerr-ayush
Copy link
Contributor Author

developerr-ayush commented Oct 10, 2023

so we have video playforms in that the second function can be used to show the live duration and the other one is kinda hard to tell what will be helpful from that @appgurueu

@developerr-ayush
Copy link
Contributor Author

i have faced this one i have to make an timer for OTP for that I have to take 30 sec, 5 min , 30 min. so in this case I have made this algo for first function which has names in output. second one was a video player to show live duration counter as I was getting data as ms

@raklaptudirm
Copy link
Member

That is not the point @developerr-ayush. It maybe a useful modular piece of code, but remember that this repository is not supposed to be used as a module. All the code added here should provide some educational value to the reader, and therefore useful but trivial algorithms won't be accepted.

@developerr-ayush
Copy link
Contributor Author

Okay i think its useless then

@developerr-ayush developerr-ayush deleted the Format-Duration branch October 10, 2023 13:56
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