Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Updates to the CalendarDay field #2922

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/tutorials/add-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ module.exports = {
// added fields
deadline: {
type: CalendarDay,
format: 'Do MMMM YYYY',
yearRangeFrom: '2019',
yearRangeTo: '2029',
dateFrom: '2019-01-01',
dateTo: '2029-01-01',
isRequired: false,
defaultValue: new Date().toISOString('YYYY-MM-DD').substring(0, 10),
defaultValue: new Date().toISOString('YYYY-MM-DD').substring(0, 10), // Today's date
},
assignee: {
type: Text,
Expand Down
2 changes: 1 addition & 1 deletion packages/arch/packages/day-picker/src/TextDayTimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function formatDateTime(date) {
// why are we using moment when it's so large and provides a mutable API?
// because chrono uses it and consistency is nice and
// will probably make bugs with conversion less likely
return date ? moment.parseZone(date).format('h:mm A Do MMMM YYYY Z') : '';
return date ? moment.parseZone(date).format('h:mm A do MMMM YYYY Z') : '';
}

function parseDate(value) {
Expand Down
4 changes: 2 additions & 2 deletions packages/fields/src/types/DateTime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keystone.createList('User', {
fields: {
lastOnline: {
type: DateTime,
format: 'MM/DD/YYYY h:mm A',
format: 'MM/dd/yyyy h:mm a',
yearRangeFrom: 1901,
yearRangeTo: 2018,
yearPickerType: 'auto',
Expand All @@ -39,7 +39,7 @@ keystone.createList('User', {

#### `format`

Defines the format of the string that the component generates. For example, `MM/DD/YYYY h:mm A`.
Defines the format of the string that the component generates. For example, `MM/dd/yyyy h:mm A`.

#### `yearRangeFrom`

Expand Down
2 changes: 1 addition & 1 deletion packages/list-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ keystone.createList('ListWithPlugin', {
| ---------------- | -------- | ------------------- | ----------------------------------------- |
| `createdAtField` | `String` | `createdAt` | Name of the `createdAt` field. |
| `updatedAtField` | `String` | `updatedAt` | Name of the `createdAt` field. |
| `format` | `String` | `MM/DD/YYYY h:mm A` | Format of the generated `DateTime` field. |
| `format` | `String` | `MM/dd/yyyy h:mm a` | Format of the generated `DateTime` field. |
| `access` | `Object` | See: access | Change default access controls. |

### `access`
Expand Down
2 changes: 1 addition & 1 deletion packages/list-plugins/atTracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ keystone.createList('ListWithPlugin', {
| ---------------- | -------- | ------------------- | ----------------------------------------- |
| `createdAtField` | `String` | `createdAt` | Name of the `createdAt` field. |
| `updatedAtField` | `String` | `updatedAt` | Name of the `updatedAt` field. |
| `format` | `String` | `MM/DD/YYYY h:mm A` | Format of the generated `DateTime` field. |
| `format` | `String` | `MM/dd/yyyy h:mm a` | Format of the generated `DateTime` field. |
| `access` | `Object` | See: access | Change default access controls. |

### `access`
Expand Down