twinssbc / AngularJS-ResponsiveCalendar

A pure AngularJS responsive calendar directive
http://twinssbc.github.io/AngularJS-ResponsiveCalendar/demo/
MIT License
112 stars 77 forks source link

Change hours and minutes to 24h format #11

Closed ph3b closed 9 years ago

ph3b commented 9 years ago

Hello,

I'm wondering if there is anyway to change the the hour-mode in weekview to 24-hours format.

Thanks in advance

twinssbc commented 9 years ago

@ph3b Currently the calendar doesn't provide you to specify a format for the hour column in weekview. If you want to change it, you can go to the weekview.html.

Modify below lines to use any format you want to display, thanks.

    <td class="calendar-hour-column text-right">
        {{$index<12?($index === 0?12:$index)+'am':($index === 12?$index:$index-12)+'pm'}}
    </td>
ph3b commented 9 years ago

Awesome! Got it working.

<td class="calendar-hour-column text-right">
                {{$index<10?'0' + $index + ':00' : $index + ':00'}}
            </td>

This works if anyone needs it.