开发者

Remove leading zero from jclock

开发者 https://www.devze.com 2023-01-15 09:21 出处:网络
Anyone ever used jclock and know how to remove the leading zero for th开发者_开发技巧e 12h setting?There is no direct way of doing this with jclock because it displays the time as per the format prope

Anyone ever used jclock and know how to remove the leading zero for th开发者_开发技巧e 12h setting?


There is no direct way of doing this with jclock because it displays the time as per the format properties passed to it.

If you are comfortable changing the jclock code you can change the lines like this one

  case "M": // minute as a decimal number
          return ((dateObject.getMinutes() 

to

case "M": // minute as a decimal number return dateObject.getMinutes();

I'd advise you may be add you own format property, using a suitable name like "X" and return it without the leading zeros or whatever changes you prefer

0

精彩评论

暂无评论...
验证码 换一张
取 消