小编sur*_*esh的帖子

如何为react js表单提供验证

如何为反应形式提供验证.

我采取了两个领域的形式.如果启用了两个字段,则只需启用保存按钮.

import React from 'react'
import { Button, Checkbox, Form } from 'semantic-ui-react'

const FormExampleForm = () => (
  <Form>
    <Form.Field>
      <label>First Name</label>
      <input placeholder='First Name' />
    </Form.Field>
    <Form.Field>
      <label>Last Name</label>
      <input placeholder='Last Name' />
    </Form.Field>
    <Form.Field>
      <Checkbox label='I agree to the Terms and Conditions' />
    </Form.Field>
    <Button type='submit'>Submit</Button>
  </Form>
)

export default FormExampleForm
Run Code Online (Sandbox Code Playgroud)

reactjs

5
推荐指数
1
解决办法
3035
查看次数

如何在 postgres sql 查询中仅计算两个日期之间的天数。

假设我给出了两个日期,如果差是一个月,那么它应该显示为 30 天。即使是几个月也需要转换成我已经尝试过的天数(日期,现在():: 没有时区的时间戳)但它是给出月-日-年格式。例如:10 mons 24 days 13:57:40.5265.但我需要以下方式。例如,如果有两个月的差异,那么我需要输出 60 天。

sql postgresql date-arithmetic

1
推荐指数
1
解决办法
1万
查看次数

如何在postgres sql查询中获取当前月份firstdate和lastdate

我想获得当月的第一个和最后一个日期(如30日或31日).如何通过使用postgress sql查询获得此日期.

postgresql date sql-date-functions timestamp-with-timezone

1
推荐指数
1
解决办法
5264
查看次数