10 examples of 'datepicker onchange' in JavaScript

Every line of 'datepicker onchange' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
86registerOnChange(fn) {
87 this._onChange = fn;
88}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

90public registerOnChange( fn: any ): void {
91 this.onModelChange = fn;
92}
64handleChange(date) {
65 if (!date) {
66 if (this.props.onChange) {
67 this.props.onChange(null, null, '');
68 }
69 return;
70 }
71 if (this.props.onChange) {
72 this.props.onChange(
73 date.toDate().toISOString(), // ISO 8601
74 date.format(this.props.dateFormat), // 使用moment.js按照用户指定的格式进行格式化
75 date
76 );
77 }
78}
48onChange(value) {
49 this.value = value;
50 this.props.onChange(value);
51}
56onSelectValueChange(value) {
57 this.selectValueChange.emit(value);
58}
95registerOnChange(fn): void {
96 this.onChange = fn;
97}
40onChange(value){
41 this.props.onChange && this.props.onChange(value)
42}
194registerOnChange(fn: (time: TimeObject) => void): void {
195 this.onChange = fn;
196}
77onValueChange(value: CompatibleValue): void {
78 this.thyValue = value;
79 if (this.isRange) {
80 const vAsRange: any = this.thyValue;
81 if (vAsRange.length) {
82 this.onChangeFn([vAsRange[0].nativeDate, vAsRange[1].nativeDate]);
83 } else {
84 this.onChangeFn([]);
85 }
86 } else {
87 if (this.thyValue) {
88 this.onChangeFn((this.thyValue as any).nativeDate);
89 } else {
90 this.onChangeFn(null);
91 }
92 }
93 this.onTouchedFn();
94}
82updateDatePickerInputHandler(d) {
83 if (this.type === 'single') {
84 if (d.selectedDay.date) {
85 this.inputFieldDate = d.selectedDay.date.toLocaleDateString();
86 this.selectedDay = d.selectedDay;
87 this.selectedDayChange.emit(this.selectedDay);
88 }
89 } else {
90 if (d.selectedFirstDay.date) {
91 this.selectedRangeFirst = d.selectedFirstDay;
92 this.selectedRangeLast = d.selectedLastDay;
93 this.selectedRangeFirstChange.emit(this.selectedRangeFirst);
94 this.selectedRangeLastChange.emit(this.selectedRangeLast);
95 this.inputFieldDate = d.selectedFirstDay.date.toLocaleDateString() + ' - ' + d.selectedLastDay.date.toLocaleDateString();
96 }
97 }
98}

Related snippets