Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 2 made on Wednesday June 9, 2021 at 12:47
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,997
LOL.

The Javascript engine you are running in the Pronto is circa 2008 (EcmaScript 5 - ES5) which is way before padStart was added to String.

You must resort to the old way or adding what is known as a mixin
or polyfills.

Old way:

var toPad = 1;
var padded = ("00" + toPad).substring(0,2);


A quick google (string padstart polyfill) finds this link which has exactly what you need. [Link: vanillajstoolkit.com]

If you look at this code, however, it's also looking for a 'repeat' function on String which also is not part of ES5.

Here's a link for that:

[Link: vanillajstoolkit.com]

Last edited by Lyndel McGee on June 9, 2021 12:56.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse