siddii / angular-timer

re-usable/inter-operable AngularJS timer directive ⛺
http://siddii.github.io/angular-timer/
MIT License
793 stars 939 forks source link

configure hourUnit format #170

Open sluchznak opened 9 years ago

sluchznak commented 9 years ago

Hi. How can i specify format for hourUnit, minuteUnit and secondUnit like this: `

  • {{hours}} {{hourUnit}}
  • {{minutes}} {{minuteUnit}}
  • {{seconds}} {{secondUnit}}
  • `
    polomarcus commented 9 years ago

    Hi @sluchznak ,

    We use https://github.com/EvanHahn/HumanizeDuration.js#usage to display time units. It only allows us to display time this way:

    humanizeDuration(97320000)  // "1 day, 3 hours, 2 minutes"

    So at the moment, what you ask, having the unit translated separately from the time value is not yet possible, it would be a great Pull request to HumanizeDuration thought.

    What you can do is if your unit is hour, minute and second :

    <li class="days">
    <span class="number">{{hours}} </span><span class="text"> hour{{hoursS}}</span></li> 
    <li class="min">
    <span class="number">{{minutes}} </span><span class="text">minute{{minutesS }}</span>
    </li>
     <li class="sec">
    <span class="number">{{seconds}} </span><span class="text">second{{secondsS}} </span>
    </li>