HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall_new/buyercall/buyercall/assets/scripts/coupon.js
var coupon = function () {
    var durationSelector = '#duration';

    var $body = $('body');
    var $duration = $(durationSelector);
    var $durationInMonths = $('#duration-in-months');
    var $redeem_by = $('#redeem_by');

    $body.on('change', durationSelector, function () {
        if ($duration.val() === 'repeating') {
            $durationInMonths.show();
        }
        else {
            $durationInMonths.hide();
        }
    });

    if ($redeem_by.length) {
        $redeem_by.datetimepicker({
            widgetParent: '.dt',
            format: 'YYYY-MM-DD HH:mm:ss',
            icons: {
                time: 'fa fa-clock-o',
                date: 'fa fa-calendar',
                up: 'fa fa-arrow-up',
                down: 'fa fa-arrow-down',
                previous: 'fa fa-chevron-left',
                next: 'fa fa-chevron-right',
                clear: 'fa fa-trash'
            }
        });
    }
};

module.exports = coupon;