Pierre Hébert could you try this in text bindings. I don’t understand why it’s not working directly. I have to dummy edit the bindings for having it working.
If it works when restarting the app but not when restarting the phone, then it would mean that the alarm is simply not yet available at boot, maybe it’s made available a little bit latter. But I don’t know why it wouldn’t be there, I tested the binding successfully on an emulator, works ok after a restart.
< ![CDATA[
var unused = $ll_hour;
var Alr=LL.getContext().getSystemService(LL.getContext().ALARM_SERVICE).getNextAlarmClock();
if(Alr == null) {var AlrmFr = “Pas de réveil”};
if(Alr != null) {
AlrmE = new Date(Alr.getTriggerTime()).toString();
Jour = AlrmE.substring(0,4);
Mois = AlrmE.substring(4,8);
Heure = AlrmE.substring(15,21);
// AlrmF1 = new Date(Alr.getTriggerTime()).toLocaleString();
if(Mois == “Feb “) {var Mois = “Fev “};
if(Jour == “Mon “) {var Jour= “Lun “};
if(Jour == “Tue “) {var Jour= “Mar “};
if(Jour == “Wed “) {var Jour= “Mer “};
if(Jour == “Thu “) {var Jour= “Jeu “};
if(Jour == “Fri “) {var Jour= “Ven “};
if(Jour == “Sat “) {var Jour= “Sam “};
if(Jour == “Sun “) {var Jour= “Lun “};
// Mois = AlrmF1.substring(3,9);
//JourN = AlrmF1.substring(0,2);
JourN = AlrmE.substring(8,11);
MoisF = Mois.charAt(0).toUpperCase() + Mois.substring(1,4).toLowerCase() + ” “;
AlrmFr = Jour + JourN + MoisF + Heure ;
};
return AlrmFr;
]]>
< ![CDATA[
I had to translate Day & month because of the locale string was not fine.
2 issues
1) no alarm when restarting the device even there is.
2)localeString is not right for FR. So I used English string
]]>
< ![CDATA[
Pierre Hébert could you try this in text bindings. I don’t understand why it’s not working directly. I have to dummy edit the bindings for having it working.
]]>
< ![CDATA[
If it works when restarting the app but not when restarting the phone, then it would mean that the alarm is simply not yet available at boot, maybe it’s made available a little bit latter. But I don’t know why it wouldn’t be there, I tested the binding successfully on an emulator, works ok after a restart.
]]>
< ![CDATA[
Pierre Hébert yes.Now working fine after some reboots. Strange
]]>