使用meioMask插件是否有任何方法可以设置掩码,以便在24小时内接受有效时间,甚至在12小时系统中接受更好的时间?
$("#txtTime").setMask('time');
Run Code Online (Sandbox Code Playgroud)
这个插件有一个预定义的24小时'时间'掩码,但它不太正确,所以你可以输入无效的时间值,如"29:00".这个面具是不适合这个目的,如果不是哪个会更好?
有什么方法可以将表达式列表合并为一个吗?我有List<Expression<Child, bool>> expList并尝试合并为一个(AndAlso)并得到
Expression<Child, bool> combined = Combine(expList);
Run Code Online (Sandbox Code Playgroud)
组合表达的预期用法是:
//type of linqFilter is IQueryable<Parent>
linqFilter = linqFilter.SelectMany(p => p.Child).
Where(combined).Select(t=> t.Parent);
Run Code Online (Sandbox Code Playgroud)
我正在尝试这样的事情:
var result = expList.Cast<Expression>().
Aggregate((p1, p2) => Expression.AndAlso(p1, p2));
Run Code Online (Sandbox Code Playgroud)
但得到一个例外
{"The binary operator AndAlso is not defined for the types 'System.Func`2[Child,System.Boolean]' and 'System.Func`2[Child,System.Boolean]'."}
Run Code Online (Sandbox Code Playgroud)