如何解决C#使用linq将字符串搜索到日期时间表列中
/** Third Party Libraries */
import { createSlice } from '@reduxjs/toolkit'
import qs from 'qs'
/**Axios Wrapper...nothing fancy here*/
import CycloneAPIInstance from 'common/cyclone/api/api.client'
import CycloneConfig from 'config/base'
/** Main API Server URL */
const API_URL = CycloneConfig.API_URL
const session = JSON.parse(localStorage.getItem('authentication'))
/** Define Initial State */
export const initialState = session
? {
hasErrors: false,session: session,}
: {
hasErrors: false,session: [],}
/** Define Slice */
const authenticationSlice = createSlice({
name: 'authentication',initialState,reducers: {
authenticateUser: (state) => {
state.hasErrors = false
},authenticateUserSuccess: (state,{ payload }) => {
state.hasErrors = false
state.session = payload
console.log(state.session)
},authenticateUserFailure: (state,{ payload }) => {
state.hasErrors = true
state.session = payload
},deauthenticateUser: (state) => {
state.session = []
},},})
export const {
authenticateUser,authenticateUserSuccess,authenticateUserFailure,deauthenticateUser,} = authenticationSlice.actions
export const authenticationSelector = (state) => state.authentication
export default authenticationSlice.reducer
export function authenticateByLogin(user_name,user_password) {
let requestBody = {
user_name: user_name,user_password: user_password,}
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',}
return async (dispatch) => {
dispatch(authenticateUser())
try {
const response = await CycloneAPIInstance.post(
API_URL + 'auth/login',qs.stringify(requestBody),config
)
//console.log(response.data.content)
localStorage.setItem('session',JSON.stringify(response.data.content))
dispatch(authenticateUserSuccess(response.data.content))
} catch (error) {
//console.log(JSON.stringify(error.response.data))
dispatch(authenticateUserFailure(error.response.data))
}
}
}
export function deauthenticateByLogout() {
return async (dispatch) => {
dispatch(deauthenticateUser())
localStorage.removeItem('session')
}
}
搜索字符串未将数据搜索到datetime中,假设datetime tostring返回“ 04/10/2020 02:05:41 PM”,因此,如果搜索字符串是04/10或10/2020或2020,则应返回所有匹配行,如果搜索字符串“ 04/10/2020”,则应返回所有匹配行
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。