tui.date-picker icon indicating copy to clipboard operation
tui.date-picker copied to clipboard

input tag에 이미 데이터가 있는 경우 어떻게 해야 date-picker에서 보일까요?

Open dongsilove opened this issue 5 years ago • 5 comments

input type="text" class="datepicker-input" aria-label="Date-Time" value="2019-05-09"

보통 날짜를 value에 위와 같이 setting하게 되는데 기존의 데이터를 date-picker에서 보이도록 하려면 어떻게 해야할까요?

dongsilove avatar May 29 '19 04:05 dongsilove

안녕하세요. 질문해주신 내용을 보면 value에 값을 그대로 넣으주시면 될 것 같은데요. 사용예제나 코드를 구체적으로 보여주실수 있을까요?

jung-han avatar May 29 '19 06:05 jung-han

다음은 tui date-picker에서 제공해주는 예제이구요. value="2019-05-09"만 input tag에 추가했어요. 이렇게 했을 때 tui-date-picker 달력이 떴을 때 해당 value의 일자가 선택되어 있었으면 좋겠는데 안되네요

1. Basic
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="https://uicdn.toast.com/tui.code-snippet/v1.5.0/tui-code-snippet.js"></script>
<script type="text/javascript" src="../dist/tui-date-picker.js"></script>
<script class="code-js">
    var datepicker = new tui.DatePicker('#wrapper', {
        date: new Date(),
        language: 'ko',
        input: {
            element: '#datepicker-input',
            format: 'yyyy-MM-dd'
        }
    });
</script>

-----Original Message----- From: "한정"[email protected] To: "nhn/tui.date-picker"[email protected]; Cc: "dongsilove"[email protected]; "Author"[email protected]; Sent: 2019-05-29 (수) 15:11:23 (GMT+09:00) Subject: Re: [nhn/tui.date-picker] input tag에 이미 데이터가 있는 경우 어떻게 해야 date-picker에서 보일까요? (#35)

안녕하세요. 질문해주신 내용을 보면 value에 값을 그대로 넣으주시면 될 것 같은데요. 사용예제나 코드를 구체적으로 보여주실수 있을까요? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

dongsilove avatar May 30 '19 01:05 dongsilove

처음에 datepicker 인스턴스를 생성할때 date옵션에 new Date() 대신 원하는 값을 넣어주시면 될 것 같습니다.

jung-han avatar May 30 '19 07:05 jung-han

그렇다면 각 날짜입력란마다 하나의 datepicker가 필요하다는 말씀이네요. 제가 이해한 것이 맞나요? -------- 원본 이메일 --------발신: 한정 [email protected] 날짜: 19/5/30 오후 4:48 (GMT+09:00) 받은 사람: "nhn/tui.date-picker" [email protected] 참조: dongsilove [email protected], Author [email protected] 제목: Re: [nhn/tui.date-picker] input tag에 이미 데이터가 있는 경우 어떻게 해야 date-picker에서 보일까요? (#35) 처음에 datepicker 인스턴스를 생성할때 date옵션에 new Date() 대신 원하는 값을 넣어주시면 될 것 같습니다.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

[

{

"@context": "http://schema.org",

"@type": "EmailMessage",

"potentialAction": {

"@type": "ViewAction",

"target": "https://github.com/nhn/tui.date-picker/issues/35?email_source=notifications\u0026email_token=AE7N34VRGYCRM6SZTQMSRKLPX6BGVA5CNFSM4HQI5K2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWRUMBY#issuecomment-497239559",

"url": "https://github.com/nhn/tui.date-picker/issues/35?email_source=notifications\u0026email_token=AE7N34VRGYCRM6SZTQMSRKLPX6BGVA5CNFSM4HQI5K2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWRUMBY#issuecomment-497239559",

"name": "View Issue"

},

"description": "View this Issue on GitHub",

"publisher": {

"@type": "Organization",

"name": "GitHub",

"url": "https://github.com"

}

}

]

dongsilove avatar May 30 '19 08:05 dongsilove

@dongsilove 넵 맞습니다.

jung-han avatar Jun 20 '19 01:06 jung-han