jsmreese / moment-duration-format

Format function plugin for the Moment Duration object.
MIT License
967 stars 121 forks source link

Assistance using this library with ion.rangeSlider #33

Closed CharlesOkwuagwu closed 9 years ago

CharlesOkwuagwu commented 9 years ago

Please i need some assistance using this library with

http://ionden.com/a/plugins/ion.rangeSlider/demo_advanced.html

There are no JavaScript errors ... the slider simply stops working once i apply the duration format

Please help,

Thanks.

<script src="js/jquery-2.1.1.js"></script>

<script src="js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>

<script src="js/plugins/moment/moment.min.js"></script>
<script src="js/plugins/moment/moment-duration-format.js"></script>

<script type="text/javascript">
    $(function () {
        $("#txtDuration").ionRangeSlider({
            min: +moment.duration(15, "minutes").format("h [hrs], m [min]"),
            max: +moment.duration(300, "minutes").format("h [hrs], m [min]"),
            type: 'single',
            step: 5,
            prettify: function (num) { return moment.duration(num, "minutes").format("h [hrs], m [min]"); }
        });

        $("#txtNegative").ionRangeSlider({
            min: 0,
            max: 3,
            type: 'single',
            step: 0.1,
            prettify: false
        });

    });
</script>
CharlesOkwuagwu commented 9 years ago

Solved.