Read the statement by Michael Teeuw here.
Capitalize the first letter of the day/month in clock module
-
@idoodler Yes, I’m using the default clock module. Can you show me how implement this thing? I’m a bit novice here :smiling_face_with_open_mouth_cold_sweat:
-
-
@mykle1 thank you, I’ll give it a try later!
Meanwhile, I tried to find a solution and I think I found a very basic one. I simply edited the file “moment-with-locales.js” in
/home/pi/MagicMirror/vendor/node_modules/moment/min/moment-with-locales.js
by changing the parts related to my language fromhooks.defineLocale('it', { months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'), weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'),
to
hooks.defineLocale('it', { months : 'Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre'.split('_'), monthsShort : 'Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic'.split('_'), weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'),
I noticed that this change works on all other modules
-
@el-bardo I would not recogmend to edit the moment.js library. Yes, it may solve your problem but changes to this library will also affect other modules.
In general it is unsave to just adapt a 3rd party library.
-
@idoodler What could happen? Malfunctions and errors?
-
@el-bardo You never know how other module devs use such functions.
Always use the most non-inversive way which would be the custom CSS way.