1

I cannot implement full AM/PM format for hours, there is 12:00 AM but after click on the calendar there are from 0:00 to 23:00:

enter image description here

Source code:

            <b>From</b>: <a class="dropdown-toggle" id="dropdown2" role="button" data-toggle="dropdown" href="#"
            style="font-weight: bold;" ng-click="events.filter.datePicked1 = true">{{events.filter.state.dateFrom | date:'MM/dd/yyyy'}}</a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" ng-if="events.filter.datePicked1">
                <datetimepicker data-ng-model="events.filter.state.dateFrom"
                data-datetimepicker-config="{ minView: 'day' }"
                />
            </ul>
            <a class="dropdown-toggle" id="dropdown2" role="button" data-toggle="dropdown" href="#"
            style="font-weight: bold;" ng-click="events.filter.datePicked1 = false">{{events.filter.state.dateFrom | date:'hh:mm a'}}</a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" ng-if="!events.filter.datePicked1">
                <datetimepicker data-ng-model="events.filter.state.dateFrom"
                data-datetimepicker-config="{ minView: 'minute', startView : 'hour', minuteStep: 1 }"
                />
            </ul>

1 Answer 1

1

The time format in the display is controlled by moment.js - see http://momentjs.com/docs/#/i18n/

By default, the datetimepicker uses the format for the users locale. I assume your locale uses 24 hour format since that is what is displayed. If you want the same format for all users they you can create your own locale with the format you would like.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer, application works on Tomcat and there are some strange behaviour. I just changed on date picker ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.