DateTime data type format and localization
DateTime data type format and localization
Hello to everybody
Any possible way to change the format of the form for the data type "DateTime", weeks starting on Monday and localization?. I've noticed that the "date" type is adapted to another language, but DateTime remains in English, with the week starting on Sunday
Thanks!
Any possible way to change the format of the form for the data type "DateTime", weeks starting on Monday and localization?. I've noticed that the "date" type is adapted to another language, but DateTime remains in English, with the week starting on Sunday
Thanks!
Re: DateTime data type format and localization
Hi,
you can try
moment.updateLocale('en', {week: {dow: 1}});
you can try
moment.updateLocale('en', {week: {dow: 1}});
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: DateTime data type format and localization
Hello.
Thanks for the answer
Should I put it in the [tablename]-dv.js file in the hooks directory?
Thanks for the answer
Should I put it in the [tablename]-dv.js file in the hooks directory?
Re: DateTime data type format and localization
Did you try it?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: DateTime data type format and localization
no idea what to do. I put the line indicated in the [tablename]-dv.js file and nothing has changed
I've been looking in the folder:
/resources/bootstrap-datetimepicker
and
https://malot.fr/bootstrap-datetimepicker/
but the files are not understandable to me
Any ideas?
Thank you
I've been looking in the folder:
/resources/bootstrap-datetimepicker
and
https://malot.fr/bootstrap-datetimepicker/
but the files are not understandable to me
Any ideas?
Thank you
Re: DateTime data type format and localization
I don't know if I have explained myself well (English is not my language). I need the Datetime widget in Spanish with the week starting on Monday
I'm a real newbie with no knowledge of bootstrap, javascript or css
Thank you!
I'm a real newbie with no knowledge of bootstrap, javascript or css
Thank you!
Re: DateTime data type format and localization
I added the line
<script src="hooks/AppGiniHelper.min.js"></script>
to header-extras.php
and by adding the line :
moment.updateLocale('en', {week: {dow: 1}});
to [tablename]-dv.js
I got the week to start on Monday.
If I change it to :
moment.updateLocale('es', {week: {dow: 1}});
it continues in English and the start of the week returns to Sunday
I understand this is because there is no translation of the bootstrap-datetimepicker into languages other than English. On the other hand, it doesn't seem to work if I don't have the bizzworxx javascript helper installed. Would you know where I can add the month and day names in Spanish to add them to this widget?
Thank you
<script src="hooks/AppGiniHelper.min.js"></script>
to header-extras.php
and by adding the line :
moment.updateLocale('en', {week: {dow: 1}});
to [tablename]-dv.js
I got the week to start on Monday.
If I change it to :
moment.updateLocale('es', {week: {dow: 1}});
it continues in English and the start of the week returns to Sunday
I understand this is because there is no translation of the bootstrap-datetimepicker into languages other than English. On the other hand, it doesn't seem to work if I don't have the bizzworxx javascript helper installed. Would you know where I can add the month and day names in Spanish to add them to this widget?
Thank you
Re: DateTime data type format and localization
For me it is getting confusing here and I'd like to clean up a bit:
Stay tuned...
- Just including AppGiniHelper.min.js does not change any default behaviour or options on standard AppGini datetime fields.
- moment.js get's included by default (actually it is moment-with-locales.min.js)
and there is a spanish localization included - Also bootstrap-timepicker and bootstrap-datetimepicker get included by default
Stay tuned...
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
Name of field is "datetime".
Set locale to "es" (=spanish)
Set first day of week = 0 (Sunday – domingo)
Code
Result
Set locale to "es" (=spanish)
Set first day of week = 0 (Sunday – domingo)
Code
Code: Select all
// file: TABLENAME-dv.js
moment.updateLocale('es', {week: {dow: 0}});
$j("#datetime").parent().datetimepicker({
locale: 'es'
});
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
Name of field is "datetime".
Set locale to "es" (=spanish)
Set first day of week = 1 (Monday – lunes)
Code
Result
I hope this will help you configuring your datetimepickers.
Regards,
Jan
Set locale to "es" (=spanish)
Set first day of week = 1 (Monday – lunes)
Code
Code: Select all
// file: TABLENAME-dv.js
moment.updateLocale('es', {week: {dow: 1}});
$j("#datetime").parent().datetimepicker({
locale: 'es'
});
I hope this will help you configuring your datetimepickers.
Regards,
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
Hello. Thank you for the answer and the clarifications
The same behavior I told you about before:
moment.updateLocale('es', {week: {dow: 1}});
$j("#datetime").parent().datetimepicker({
locale: 'es'
});
English language, first day of the week Sunday
moment.updateLocale('en', {week: {dow: 1}});
$j("#datetime").parent().datetimepicker({
locale: 'en'
});
English language, first day of the week Monday
Somehow, when I change the locale to 'es', it stays in English and ignores the 'dow' parameter (or the entire code). In case anyone is wondering, I haven't modified any other files. I'm working with the default appgini generated code
The same behavior I told you about before:
moment.updateLocale('es', {week: {dow: 1}});
$j("#datetime").parent().datetimepicker({
locale: 'es'
});
English language, first day of the week Sunday
moment.updateLocale('en', {week: {dow: 1}});
$j("#datetime").parent().datetimepicker({
locale: 'en'
});
English language, first day of the week Monday
Somehow, when I change the locale to 'es', it stays in English and ignores the 'dow' parameter (or the entire code). In case anyone is wondering, I haven't modified any other files. I'm working with the default appgini generated code
Re: DateTime data type format and localization
Firefox cache cleaned
apache restarted
tested with chromium
same behavior
apache restarted
tested with chromium
same behavior
Re: DateTime data type format and localization
Can you please check if there are any warnings in the console tab of your browser's developer tools, and if there are, please post them here (as code please for better readability).
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
No errors. I've forced an error to check that it's detected. I also tried the options provided by the stackoverflow thread:
https://stackoverflow.com/questions/244 ... y#31492457
No changes
https://stackoverflow.com/questions/244 ... y#31492457
No changes
Re: DateTime data type format and localization
What about warnings?No errors.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
Code: Select all
This page uses the non standard property “zoomâ€. Consider using calc() in the relevant property values, or using “transform†along with “transform-origin: 0 0â€. entradasalida_view.php
Code: Select all
Use of Mutation Events is deprecated. Use MutationObserver instead. jquery-1.12.4.min.js:3:9646
Code: Select all
moment.updateLocale('es', {week: {dow: 1}});
$j("#datetime").parent().datetimepicker({
locale: 'es'
});
Re: DateTime data type format and localization
Three last ideas:
- Try with "es-do" instead of "es"
- Try with "de" instead of "es" (just so see if there is any effect at all)
- In dev-console tab "Sources", tab "Page", under localhost / your app directory, find resources, moment, moment-with-locales.min.js and open the contents (right-click, open in new tab).
If there is no "es" and no"es-do", there may be a problem with wrong moment library version. But honestly, this would be very, very weird if you are using standard AppGini >5.7 generated code. I cannot believe "es" was missing.
In the source-code-view tab, search for "es" (CTRL+F). There should be at least one match for "es" like this one here:
You can also search for "es-do". There should be one match, too.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
With other languages, for example 'de' or 'es-do', the same behaviour. I've proven that they exist:
definelocale("es"...
definelocale("es-do"...
in the file "moment-with-locales.min.js" (using appgini 5.82)
Well, at least we got the week started on a Monday
Thank you very much for your time, Mr. Setzer.
definelocale("es"...
definelocale("es-do"...
in the file "moment-with-locales.min.js" (using appgini 5.82)
Well, at least we got the week started on a Monday
Thank you very much for your time, Mr. Setzer.
Re: DateTime data type format and localization
One more idea:
In ./language.php you could check the value of
In defaultLang.php the default value should be set to 'en' and then, including language.php should overwrite 'en' by 'es' (in your case).
Default value configured in ./defaultLang.php:
Give it a try with 'es' in language.php and remove the javascript at first. Then try the javascript command by command and always reload your browser with clearing cache.
In ./language.php you could check the value of
Code: Select all
$Translation['datetimepicker locale'] = 'de';
Default value configured in ./defaultLang.php:
Code: Select all
$Translation['datetimepicker locale'] = 'en';
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
It works!
Modifying :
in file language.php (and deleting javascript code in TABLE-dv.js)
Thanks!
Modifying :
Code: Select all
$Translation['datetimepicker locale'] = 'es';
Thanks!
Last edited by jalfonso on 2020-05-26 16:47, edited 1 time in total.
Re: DateTime data type format and localization
I'm wondering, what was inside language.php before and where did you get that file from? It should be 'es' by default in spanish language file.
Anyway, I'm happy we got it!
Best,
Jan
Anyway, I'm happy we got it!
Best,
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: DateTime data type format and localization
I think it's an error in the language.php file downloaded from the web. You see, the whole file is translated but the line referring to "datetimepicker locale" is "en"
https://cdn.bigprof.com/appgini-desktop ... panish.zip
Thank you again
https://cdn.bigprof.com/appgini-desktop ... panish.zip
Thank you again