or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

configuration-options.mdevent-handling.mdglobal-api.mdindex.mdinstance-methods.mdinternationalization.mdplugin-interface.md
tile.json

plugin-interface.mddocs/

0

# Plugin Interface

1

2

The main jQuery plugin interface for jquery-datetimepicker provides initialization and method invocation capabilities.

3

4

## Capabilities

5

6

### Plugin Initialization

7

8

Initialize a datetimepicker on selected elements with optional configuration.

9

10

```javascript { .api }

11

/**

12

* Initialize datetimepicker on selected elements

13

* @param options - Configuration options for the picker

14

* @returns jQuery object for chaining

15

*/

16

function datetimepicker(options?: DateTimePickerOptions): JQuery;

17

```

18

19

**Usage Examples:**

20

21

```javascript

22

// Basic initialization

23

$('#myinput').datetimepicker();

24

25

// With configuration options

26

$('#myinput').datetimepicker({

27

format: 'Y-m-d H:i',

28

step: 30,

29

minDate: '2023-01-01'

30

});

31

32

// Chaining

33

$('#myinput').datetimepicker({

34

timepicker: false

35

}).addClass('date-only');

36

```

37

38

### Method Invocation

39

40

Call methods on existing datetimepicker instances using string commands.

41

42

```javascript { .api }

43

/**

44

* Invoke methods on existing datetimepicker instances

45

* @param method - Method name to invoke

46

* @returns jQuery object for chaining or method-specific return value

47

*/

48

function datetimepicker(method: string, ...args: any[]): any;

49

```

50

51

### Show Method

52

53

Display the datetimepicker widget.

54

55

```javascript { .api }

56

/**

57

* Show the datetimepicker widget

58

* @returns jQuery object for chaining

59

*/

60

function datetimepicker(method: 'show'): JQuery;

61

```

62

63

**Usage Examples:**

64

65

```javascript

66

// Show the picker

67

$('#myinput').datetimepicker('show');

68

69

// Show and focus input

70

$('#myinput').datetimepicker('show').focus();

71

```

72

73

### Hide Method

74

75

Hide the datetimepicker widget.

76

77

```javascript { .api }

78

/**

79

* Hide the datetimepicker widget

80

* @returns jQuery object for chaining

81

*/

82

function datetimepicker(method: 'hide'): JQuery;

83

```

84

85

**Usage Examples:**

86

87

```javascript

88

// Hide the picker

89

$('#myinput').datetimepicker('hide');

90

```

91

92

### Toggle Method

93

94

Toggle the visibility of the datetimepicker widget.

95

96

```javascript { .api }

97

/**

98

* Toggle visibility of the datetimepicker widget

99

* @returns jQuery object for chaining

100

*/

101

function datetimepicker(method: 'toggle'): JQuery;

102

```

103

104

**Usage Examples:**

105

106

```javascript

107

// Toggle picker visibility

108

$('#myinput').datetimepicker('toggle');

109

110

// Use with button

111

$('#toggleBtn').click(function() {

112

$('#myinput').datetimepicker('toggle');

113

});

114

```

115

116

### Destroy Method

117

118

Destroy the datetimepicker instance and remove all associated event handlers.

119

120

```javascript { .api }

121

/**

122

* Destroy the datetimepicker instance

123

* @returns jQuery object for chaining

124

*/

125

function datetimepicker(method: 'destroy'): JQuery;

126

```

127

128

**Usage Examples:**

129

130

```javascript

131

// Destroy the picker

132

$('#myinput').datetimepicker('destroy');

133

134

// Destroy and reinitialize with new options

135

$('#myinput').datetimepicker('destroy').datetimepicker({

136

format: 'H:i',

137

datepicker: false

138

});

139

```

140

141

### Reset Method

142

143

Reset the input to its default value.

144

145

```javascript { .api }

146

/**

147

* Reset the input to its default value

148

* @returns jQuery object for chaining

149

*/

150

function datetimepicker(method: 'reset'): JQuery;

151

```

152

153

**Usage Examples:**

154

155

```javascript

156

// Reset to default value

157

$('#myinput').datetimepicker('reset');

158

159

// Reset multiple inputs

160

$('.datetime-inputs').datetimepicker('reset');

161

```

162

163

### Validate Method

164

165

Validate the current input value.

166

167

```javascript { .api }

168

/**

169

* Validate the current input value

170

* @returns jQuery object for chaining

171

*/

172

function datetimepicker(method: 'validate'): JQuery;

173

```

174

175

**Usage Examples:**

176

177

```javascript

178

// Validate current value

179

$('#myinput').datetimepicker('validate');

180

181

// Validate and handle result

182

$('#myinput').datetimepicker('validate');

183

if ($('#myinput').hasClass('xdsoft_invalid')) {

184

// Handle invalid input

185

}

186

```

187

188

### Plugin Defaults

189

190

Access default configuration options.

191

192

```javascript { .api }

193

/**

194

* Default configuration options for all datetimepicker instances

195

*/

196

$.fn.datetimepicker.defaults: DateTimePickerOptions;

197

```

198

199

**Usage Examples:**

200

201

```javascript

202

// Modify global defaults

203

$.fn.datetimepicker.defaults.format = 'Y-m-d H:i';

204

$.fn.datetimepicker.defaults.step = 30;

205

206

// Use custom defaults for all future instances

207

$('.datetime-inputs').datetimepicker(); // Will use modified defaults

208

```