Promact / md2

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.
http://code.promactinfo.com/md2/
MIT License
379 stars 111 forks source link

Time display error in Time picker #250

Closed jayathuam closed 7 years ago

jayathuam commented 7 years ago

Bug, feature request, or proposal:

Time displaying error in time picker. capture

What is the expected behavior?

Time should be displayed.

What is the current behavior?

Displaying time is not in the correct format.

Which versions of Angular, MD2, OS, browsers are affected?

MD2 version 0.0.25, Angular 4

Is there anything else we should know?

24 hours clock is also not working.

ph55 commented 7 years ago

@dharmeshpipariya when it will be released ? Trying to work with master - but there is an compiling errors.

mhecktor commented 7 years ago

I found a workaround that worked for me: 1.Inject the DateLocale Service 2.Set hour labels (0-24) this.dateLocale.hours = this.range(24, i => String(i));

private range<T>(length: number, valueFunction: (index: number) => T): T[] {
        const valuesArray = Array(length);
        for (let i = 0; i < length; i++) {
            valuesArray[i] = valueFunction(i);
        }
        return valuesArray;
    }