我正在尝试使用https://xdsoft.net/jqplugins/datetimepicker/
这是代码:
var date_time_picker = $('#datetimepicker').datetimepicker({
formatDate: 'd.m.Y',
formatTime: 'H:i',
startDate: '21.10.2018',
minDate:'21.10.2018',
maxDate:'27.10.2018',
showSecond: false,
step: 30,
defaultTime: '08:00'
});
date_time_picker.val('2018/10/21 08:00');
Run Code Online (Sandbox Code Playgroud)
当页面加载时,输入值如上所示,但是当我点击框并弹出日历时,时间设置为00:00:

这是一个 JSFiddle:https ://jsfiddle.net/shakedk/xpvt214o/965164/
我正在使用MATLAB创建一个对角矩阵eye(3).如何仅将数字"2"分配给主对角线下的元素?
我正在尝试导出许多常量,稍后可以将它们导入并映射为数组。我无法将它们全部放入一个对象中并导出它们,因为我正在使用泛型(OptionInterface)并且我希望保留类型验证。
目前,我将每个对象导出为命名导出,然后将所有对象导出为数组。问题是另一个开发人员可能不知道他必须向导出的数组添加新元素。
一个例子:
//ElemSettings.tsx
export interface ElemProps<OptionInterface = any> {
title: string,
key: string,
options: OptionsInterface[]
export interface SpecialOption {
s1: string,
s2: number
}
//Elements.tsx - what I wish to export
export const elemOne: ElemProps {
title: 'element One',
key: elemOne'
options: [1,2,3]
}
export const elemTwo: ElemProps {
title: 'element Two',
key: elemTwo'
options: [1,2,3]
}
export const elemThree: ElemProps<SpecialOption> {
title: 'element Two',
key: elemTwo'
options: [{s1:'one',s2:1},{s1:'two',s2:2}]
}
//This is how I export now
export const elems: …Run Code Online (Sandbox Code Playgroud)