EasyUI Forum
March 28, 2024, 02:20:57 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Slider Hours of Day increment of .5 doesnt work  (Read 4531 times)
ahybits
Newbie
*
Posts: 26


View Profile
« on: February 22, 2018, 09:36:17 AM »

I have this slider that does a range of time thought the day - works fine for each hour, but cant get .5 value so I can convert it to the half hour mark

https://jsfiddle.net/r3us9bkk/2/

Logged
ahybits
Newbie
*
Posts: 26


View Profile
« Reply #1 on: February 23, 2018, 08:10:32 AM »

I know in my jsfiddle i had increment - based on docs it should be step, either case it doeen't work for .5

It works for 1.5 but not .5 or 0.5

Other random values below 1 works --  .33 .75, .51, .4 all work
.5 and .25 doesnt
« Last Edit: February 23, 2018, 08:13:39 AM by ahybits » Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #2 on: February 23, 2018, 06:36:28 PM »

Please try to use a newer version 1.5.4.2. It can be downloaded from https://www.jeasyui.com/download/v154.php
Logged
ahybits
Newbie
*
Posts: 26


View Profile
« Reply #3 on: February 25, 2018, 09:39:54 AM »

Awesome, works now; thanks
Logged
ahybits
Newbie
*
Posts: 26


View Profile
« Reply #4 on: February 25, 2018, 11:19:13 AM »

Just incase anyone needs it; here is the function i used for the time range in the slider

Code:
function convertToTimeFormat(value) {
        if (value==0) {
            value = '12:00am'
        } else if (value<1) {
            value = '12:30am'
        } else if (value==12) {
            value = '12:00pm'
        } else if (value>12 && value<13) {
            value = '12:30pm'
        } else if (value==24) {
            value = '11:59pm'
        } else if (value>=13) {
            value = value-12
            value += 'pm'
        } else {
            value += 'am'
        }
        if (value.indexOf('.5')) value=value.replace('.5',':30')
        return value
    }
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!