TimePicker with 24-hour format and in Spanish

QuestionsTimePicker with 24-hour format and in Spanish
Montemaggiore Sebastian asked 8 years ago

Hello Abu. I have a grid with a field fo type DateTime with this format:

$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'h:i A',"opts" => array("timeOnly" => true, "timeFormat"=>"hh:mm tt"));

The problem i have is that i need a 24-hour format. I change timeFormat to

"timeFormat"=>"hh:mm G") but nothing.

On the other side where can i change the language to Spanish.

Thanks.
Montemaggiore, Sebastián.

2 Answers
Abu Ghufran answered 8 years ago

For 24hour formatting, set:

$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'H:i',"opts" => array("timeOnly" => true, "timeFormat"=>"HH:mm"));

For localization you can set you language like:

<script>
$.timepicker.regional['ru'] = {
timeOnlyTitle: 'Выберите время',
timeText: 'Время',
hourText: 'Часы',
minuteText: 'Минуты',
secondText: 'Секунды',
millisecText: 'Миллисекунды',
timezoneText: 'Часовой пояс',
currentText: 'Сейчас',
closeText: 'Закрыть',
timeFormat: 'HH:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
isRTL: false
};
$.timepicker.setDefaults($.timepicker.regional['ru']);
</script>

Sebastián Esteller answered 8 years ago

Thanks Abu.

Your Answer

9 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?