Skip to content

Added possibility to show full seconds / minutes / hours #1

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 3 commits into from
Sep 4, 2013

Conversation

kersten
Copy link

@kersten kersten commented Sep 4, 2013

This change will help me to show a timer like 235:59 (minutes:seconds), e.g. if I don't want to show hours or days.

This change will help me to show a timer like 235:59 (minutes:seconds) if I don't want to show hours or days.
added true to fullSeconds
@alexandrosm
Copy link
Owner

Hi, this looks cool.

A suggestion: Would you consider just adding fullminutes, fullhours, fullseconds to the scope without an API option? That way it's easier to use, there is less code, and I don't think the performance will suffer too much since it has to check the if statements every time anyway.

Another question is this: Why aren't you sending this pull request to @siddii directly? are you dependent on my patches in some way? I am not negative to pulling this commit, just wondering why not go to the root directly.

@kersten
Copy link
Author

kersten commented Sep 4, 2013

Hi,

I'm fairly new to angular, could you just give me a hint what you mean by putting it to the scope not as an API option?

To answer your second question, I need the autostart patch.

@alexandrosm
Copy link
Owner

Understood about the autostart commit. Hopefully siddii will merge everything soon.

What I mean about the scope, is to effectively have this:

  function calculateTimeUnits() {
    $scope.seconds = Math.floor(($scope.millis / 1000) % 60);
    $scope.minutes = Math.floor((($scope.millis / (60000)) % 60));
    $scope.hours = Math.floor((($scope.millis / (3600000)) % 24));
    $scope.fullSeconds = Math.floor($scope.millis / 1000);
    $scope.fullMinutes = Math.floor($scope.millis / 60000);
    $scope.fullHours = Math.floor($scope.millis / 3600000);
    $scope.days = Math.floor((($scope.millis / (3600000)) / 24));
  }

In this way, you can embed whatever you want in your view, full or not, and at the same time there is no need to add extra options to the API.

Let me know if I wasn't clear.

Thanks,
Alexandros

Updated usage without API
@kersten
Copy link
Author

kersten commented Sep 4, 2013

So, I hope this is the better way. Your hint was clear ;)

@alexandrosm
Copy link
Owner

Cool. Thanks for the pull, and hopefully we'll get everything merged into main soon.

alexandrosm pushed a commit that referenced this pull request Sep 4, 2013
Added possibility to show full seconds / minutes / hours
@alexandrosm alexandrosm merged commit 23b7342 into alexandrosm:master Sep 4, 2013
@kersten kersten deleted the patch-1 branch September 4, 2013 09:30
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.

2 participants