diff --git a/documentation/docs/guides-and-concepts/fields/boolean.md b/documentation/docs/guides-and-concepts/fields/boolean.md index 9a3d25ae976f..5a823da1ea26 100644 --- a/documentation/docs/guides-and-concepts/fields/boolean.md +++ b/documentation/docs/guides-and-concepts/fields/boolean.md @@ -14,14 +14,15 @@ This field is used to display boolean values and uses `` values from An Let's see how to use `` with the example in the post list. ```tsx +//highlight-next-line import { List, Table, BooleanField, Icons } from "@pankod/refine"; -export const PostList: React.FC = (props) => { +export const PostList: React.FC = () => { const { CloseCircleOutlined, CheckCircleOutlined } = Icons; return ( - - + +
//highlight-next-line ... {
- Aside Usage + BooleanField Usage
diff --git a/documentation/docs/guides-and-concepts/fields/date.md b/documentation/docs/guides-and-concepts/fields/date.md new file mode 100644 index 000000000000..85191a75c512 --- /dev/null +++ b/documentation/docs/guides-and-concepts/fields/date.md @@ -0,0 +1,60 @@ +--- +id: date +title: Date +--- + +import dateField from '@site/static/img/guides-and-concepts/fields/date/dateField.png' + +This field is used to display dates and uses [`Day.js`](https://day.js.org/docs/en/display/format) to display date format. + +## Usage + +Let's see how to use `` with the example in the post list. + +```tsx +//highlight-next-line +import { List, Table, DateField } from "@pankod/refine"; + +import { IPost } from "interfaces"; + +export const PostList: React.FC = () => { + + return ( + +
+ //highlight-next-line ... + + dataIndex="createdAt" + title="Created At" + key="createdAt" + render={(value) => ( + //highlight-next-line + + )} + /> +
+
+ ); +}; +``` + +```ts title="interfaces/index.d.ts" +export interface IPost { + id: string; + createdAt: string; +} +``` + +
+
+ DateField Usage +
+ +## API Reference + +### Properties + +| Property | Description | Type | Default | +| --------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------- | ------- | +| value
Required
| Date value | `string` \| `number` \| `Date` \| `dayjs.Dayjs` | | +| [format](https://day.js.org/docs/en/display/format) | Get the formatted date according to the string of tokens passed in. | `string` \| `undefined` | `"L"` | diff --git a/documentation/docs/guides-and-concepts/fields/email.md b/documentation/docs/guides-and-concepts/fields/email.md index 78facf652af1..9e5e4ca6d1e3 100644 --- a/documentation/docs/guides-and-concepts/fields/email.md +++ b/documentation/docs/guides-and-concepts/fields/email.md @@ -20,7 +20,7 @@ export const UserList: React.FC = () => { return ( - +
//highlight-next-line ...