Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Determining Date Format when Parsing JSON data?

Featured Replies

My JSON data contains dates in one of three formats:

YYYY
YYYY-MM
YYYY-MM-DD

The field is: Items::Initial_Release

Instead of the text, I would like to have it display that as a proper date based on what's there.

1984:               Year Only
1984-08:         August, 1984
1984-08-08:   08 August, 1984

Based on the available options for formatting the date, I gather that the FileMaker Date format probably can't deal with less than the full amount of data? Or even changing it, having it be Day first if there is full data, otherwise Year, or Year, Month only.

1222950954_ScreenShot2020-10-12at03_45_21.png.85048edf56b300d856c52e612643accf.png

Otherwise, it looks like I would have to have the date field in three different formats and use Hide If .. the data is 4 characters, 7 characters, or 10 characters?

As well, no matter what I do with those format settings above, I can't enter anything less than 10 characters in the field if it's defined as a date field.

I'd like to be able to get things by date in queries, so keeping it as date format would seem to be the better way to make that work.

Only date fields can be formatted as dates - and a date field must contain a full date (i.e. a specific day in a specific month in a specific year) in order to be valid. 

There are several ways to handle partial dates (e.g. separate fields for day, month and year). In your example, it seems the simplest way would be to keep the original "date" in a Text field, and make your own calculation field to display it the way you want.

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.