nhn / tui.date-picker

Component that selects specific date.
https://nhn.github.io/tui.date-picker/latest/
MIT License
94 stars 30 forks source link

Timepicker broken | Uncaught TypeError: y is not a constructor #121

Open trymeouteh opened 1 year ago

trymeouteh commented 1 year ago

Describe the bug

Timepicker example is broken.

To Reproduce

Steps to reproduce the behavior:

  1. Use example code or code below
<link rel="stylesheet" href="node_modules/tui-date-picker/dist/tui-date-picker.min.css">

<table style="width: 650px;">
    <thead>
        <tr>
            <td>
                <h3>Basic</h3>
            </td>
            <td>
                <h3>Tab style</h3>
            </td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <div class="tui-datepicker-input tui-datetime-input tui-has-focus">
                    <input type="text" id="datepicker-input" aria-label="Date-Time">
                    <span class="tui-ico-date"></span>
                </div>
                <div id="wrapper" style="margin-top: -1px;"></div>
            </td>
            <td>
                <div class="tui-datepicker-input tui-datetime-input tui-has-focus">
                    <input type="text" id="datepicker-input-2" aria-label="Date-Time">
                    <span class="tui-ico-date"></span>
                </div>
                <div id="wrapper-2" style="margin-top: -1px;"></div>
            </td>
        </tr>
    </tbody>
</table>

<script src="node_modules/tui-date-picker/dist/tui-date-picker.min.js"></script>

<script>
    var datepicker = new tui.DatePicker('#wrapper', {
        date: new Date(),
        input: {
            element: '#datepicker-input',
            format: 'yyyy-MM-dd HH:mm A'
        },
        timePicker: true
    });

    var datepicker2 = new tui.DatePicker('#wrapper-2', {
        date: new Date(),
        input: {
            element: '#datepicker-input-2',
            format: 'yyyy-MM-dd HH:mm A'
        },
        timePicker: {
            layoutType: 'tab',
            inputType: 'spinbox'
        }
    });
</script>
  1. Look at console and see errors. "Uncaught TypeError: y is not a constructor"

Expected behavior

Timepicker will work with no errors

Desktop (please complete the following information):