Skip to content
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

Activating the 24 hours format #42

Closed
sorbing opened this issue Oct 24, 2013 · 16 comments
Closed

Activating the 24 hours format #42

sorbing opened this issue Oct 24, 2013 · 16 comments

Comments

@sorbing
Copy link

sorbing commented Oct 24, 2013

Options pick12HourFormat: false not supports.

@Eonasdan
Copy link
Owner

pick12HourFormat has been removed. Check Momentjs' documentation for formatting options

@sorbing
Copy link
Author

sorbing commented Oct 24, 2013

But I can not choose 13 hours in popup block:
screenshot
After 12 hours at 01 switches.

@Eonasdan
Copy link
Owner

Yes but you'll notice that the am/pm selector changes. If it's really that big of deal, I'll add it back in

@Eonasdan Eonasdan reopened this Oct 24, 2013
@sorbing
Copy link
Author

sorbing commented Oct 24, 2013

Yes, I noticed, but this behavior confuses people who are not related to IT) But we often create an interface for them. Approach using momentjs good, but here it is more appropriate option enable24hours (as example).
Thanks.

@Eonasdan
Copy link
Owner

Yeah you're probably correct. Be on the look out for an update.

@ailieff
Copy link

ailieff commented Oct 24, 2013

+1 for the 24hour format option.

Also, how do you change starting weekday? for language, its set to 'en', but there is no locale for 'en'.

@Eonasdan
Copy link
Owner

@johim weekday is based on the locale. There is currently no option to change that. You could look at momentjs docs about creating a custom language file to set the weekday start. According to their docs, anything that is not specified in the file defaults to en

@sorbing
Copy link
Author

sorbing commented Oct 24, 2013

About the first day of the week - I do not understand how you can set Monday through momentjs. There is a possibility set the locale to determine the first day of the week to the date:

<script>moment.lang('ru');</script>

But it will not generate the order of days in the calendar. It was be helpful.

@BurnedToast
Copy link

+1 for 24hour format option too

The first day of the week-setting for the calendar-display would be really cool too - but this should be a new "Issue"!?

I can confirm Sorbing's problem with the locale-configuration:
I use the german (de) locale. There the config says:
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}

But my calendar still appears with Sunday as first day of the week:
firstdayofweek

Found sth in the Moment documentation:
"Note: Currently, weekdays always have Sunday as index 0, regardless of the local first day of the week."
Iam still investigating

@BurnedToast
Copy link

Found a workaround for the day-of-week-Problem:
replace fillDow with that:

fillDow = function () {
    moment.lang(picker.options.language);
    var dowCnt = moment().weekday(moment().lang()._week.dow).weekday(), html = $('<tr>'), weekdaysMin = moment.weekdaysMin();
    while (dowCnt < moment().weekday(moment().lang()._week.dow).weekday() + 7) {
        html.append('<th class="dow">' + weekdaysMin[(dowCnt++) % 7] + '</th>');
    }
    picker.widget.find('.datepicker-days thead').append(html);
},

firstdayofweek_fix

Strange thing is, the currently selected day isnt highlighted anymore ...

Its reading the dow from the language configuration manually.
But its still a workaround untill Moment updates that issue!

@gjdonkers
Copy link

+1 for the 24hour format option

@BurnedToast
Copy link

Found the cause of the missing highlighting - it does not relate to my soultion, ist a general problem and can be reproduced in the documentation too - i will open a new issue

Eonasdan added a commit that referenced this issue Oct 28, 2013
@Eonasdan
Copy link
Owner

24 hour bug is fixed in the latest commit.

@sorbing
Copy link
Author

sorbing commented Oct 31, 2013

Thanks!

@psa-odoo
Copy link

psa-odoo commented Jan 8, 2014

How can i activate 24hour format?
I tried pick12HourFormat: false and use24hours: true but didn't find it working. :-/
Plz help...!!!

@Eonasdan
Copy link
Owner

Eonasdan commented Jan 8, 2014

@sahotaparamjitsingh it depends on the format you use. Those options have been removed. See moment's documentation for formatting.

@ghost ghost locked and limited conversation to collaborators Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants