GNUI Start your next web project with GNUI.
Gn.util

Datepicker

/scss/controls/datepicker.scss
v.0.1.0 javascript

생성 옵션

<input type="text" class="new-datepicker" />
<input type="text" class="new-datetimepicker-without-icon" />
<input type="text" class="new-datetimepicker" />
  Gn.create('datepicker', {
    target: '.new-datepicker',
    value: '',
    dateFormat: 'yyyy-MM-DD',
    min: '-1M',
    max: '1M',
    type: 'date'
  });
  Gn.create('datepicker', {
    target: '.new-datetimepicker-without-icon',
    type: 'datetime',
    value: '2021-10-10 10:01:11',
    hasIcon: false,
    onClose: function () {
      console.log('창이 닫힙니다.');
    }
  });
  Gn.create('datepicker', {
    target: '.new-datetimepicker',
    type: 'datetime',
    writable: false,
    textSets: {
      placeholder: 'pick a date'
    }
  });
name type default description
target string datepicker 생성 타겟
textSets placeholder string
locale 'ko'|'en' ko 표기문구 언어
type string date picker type : date | datetime
timeFormat string hh:mm:ss 시간 형식 (hh:mm:ss, hh:mm)
size string 'small','normal','medium','large'
value string | Date now 초기 날짜, 시간 값
width string 165px 입력 input 크기
hasIcon boolean true 달력 아이콘 표시여부
disabled boolean false Disable 여부
readonly boolean false 읽기전용 여부
writable boolean true 입력가능 여부
min string 선택 할 수 있는 범위의 시작일 ('2021-04-02', '-5d', '-1W', '-1M'...)
max string 선택 할 수 있는 범위의 종료일 ('2021-10-02', '3d', '2W', '1M'...)
onClose function 창을 닫을때 수행될 이벤트

메소드

name return description
change(date) void 날짜 값을 변경한다.
getDate() String 날짜 값을 문자열로 반환한다.
getTime() Date 날짜 값을 타임스탬프 형식으로 반환한다.
disable() void Disabled 처리한다.
enable() void Enabled 처리한다.