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.

very very versatile date field

Featured Replies

OK, one for you calculation geniuses.

I have developed a solution for a client. They want to key in dates like this:

010106

and have them change into 01/01/06 (or 1/1/2006, etc. ...any real date)

Right now I am doing this with a text field I call something like DateKeyin. A calc does a conversion then a real date field grabs the result.

There must be a better way.

What's worse is that it punishes people who enter dates as dates. That is, I've got it smart enough to allow 01/01/06 but it won't take 1/1/06 or 1/1/2006.

Here's my calc for what it's worth:

If(IsEmpty(DateKeyIn);Right(0&Month(Get(CurrentDate));2)&"/"&Right(0&Day(Get(CurrentDate));2)&"/"&Right(Year(Get(CurrentDate));2)

;Let (D=DateKeyIn;

Case(

Filter(D;"/")="//";If (Length(D)=8;D;"?");

Filter(D;"/")="";If (Length(D)=6;Left(Left(D;4);2)&"/"&Right(Left(D;4);2)&"/"&Right(D;2);"?")

)

)

)

So is there a way to get this text field to also accept 1/1/06 or even 1/1/2006?

Better yet, I'd love to scrap the whole text field thing and get a real date field to process 010106 into 01/01/06 (or whatever way one wants to display it).

Can that be done?

One other thing... that first little bit in the calc is to get it to insert the current date by default. Then it processes what you key in as an auto enter replace.

I think the reason I went to a text field had something to do w/validation problems I ran into.

Edited by Guest

Hows about this:

Replace ( Replace ( Filter ( Entry;"0123456789" ) ; 5 ; 0 ; "-" ) ; 3 ; 0 ; "-" )

Where the resulting field type is Date?

--sd

  • Author

I'm quite new to Replace... but it doesn't seem to work.

If I enter "1-1-06" or "01-01-06" it returns 11-20-06... not sure why.

And "010106" it won't take at all.

Hi

give a look to this post

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.