chuushi / CoreProtect-Lookup-Web-Interface

A flexible lookup web interface for CoreProtect 2
MIT License
50 stars 14 forks source link

Moment Calendar Bug #7

Closed NoHoPeLess closed 8 years ago

NoHoPeLess commented 8 years ago

Hello :D so for now i found 1 bug with the calendar, when the locale is changed the calendar is without fuctions and seems to be broken, every date i pick results in:

`E The request did not go through properly.

i change the following:

index.php:

<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.1/moment-with-locales.min.js">// datetime-picker dependency</script> For all language support

and add to index.php :

<script> // Set the default language globally moment.locale('de'); </script> For force german language

i think an part from the lookup.js cant understand the "de"(german) format..?

`// UNIX to JS Date if(c.form.timeDividor < Math.abs(lastDataTime-r[i].time) || !moment(lastDataTime,"X").isSame(r[i].time*1000, "day")) { o += '-'

But how can i change it? Please help.. i have only standard html/php knowledge

ntimo commented 8 years ago

Iam looking forward too it :)

chuushi commented 8 years ago

Speaking of Locale, do you think it would make sense to make the entire lookup form and table column headers translatable?

chuushi commented 8 years ago

What you needed to do was modify this part of the code: https://github.com/SimonOrJ/CoreProtect-Lookup-Web-Interface/blob/master/web/res/js/lookup.js#L71

    $date.datetimepicker({
        locale: "de",
        format: c.form.dateFormat+" "+c.form.timeFormat
    });

It would look like that in your case.

This is available right now for people who used git to get the project. I'll pack an update and upload the package soon. It'll come with a locale option in config.json. :)

chuushi commented 8 years ago

The latest release should come with a one-step option to change the locale in config.json file. Give that a try, and please tell us how it goes. :)

... I forgot to implement that setting in setup.php file... so it'll only be available by directly changing the configuration file using a text editor for now.

NoHoPeLess commented 8 years ago

yeah not the problem i use notepad++ thank you for this enchant! its amazing thanks! greetz from germany ;)

ntimo commented 8 years ago

What do I have to add to get the german format? de-DE?