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
Post a Comment