jquery - JavaScript: Display positive numbers with the plus sign but not string -


using timepiker want set timezone +840:

var sign = '+'; var totalmin = 840; $('#timestart').timepicker({                 showtimezone: true,                 timeformat: "hh:mm tt",                 timezonelist:                [                 { value: -720, 'label': '(gmt-12:00) international date line west' },                    ....                 { value: +840, 'label': '(gmt+14:00) time in samoa' }               ],           timezone:sign + totalmin         }); 

if set timezone:totalmin => timezone not set

timezone:sign + totalmin returned string "+840" , timezone not set, how can set positive number + sing not string

i don't know if solution in case when plus set this

    var sign = '+';     var totalmin = 840; if(sign=='+'){     $('#timestart').timepicker({                     showtimezone: true,                     timeformat: "hh:mm tt",                     timezonelist:                    [                     { value: -720, 'label': '(gmt-12:00) international date line west' },                        ....                     { value: +840, 'label': '(gmt+14:00) time in samoa' }                   ],               timezone:+ totalmin             }); } else{ $('#timestart').timepicker({                     showtimezone: true,                     timeformat: "hh:mm tt",                     timezonelist:                    [                     { value: -720, 'label': '(gmt-12:00) international date line west' },                        ....                     { value: +840, 'label': '(gmt+14:00) time in samoa' }                   ],               timezone: totalmin             }); } 

maybe exist another


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -