Jump to content

How to get rid of seconds?


This topic is 6335 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I've been trying to to solve a small but annoying little issue.

I have a number of time fields, to which a time is copied from another time field in an another table.

In the originating field the time is input as hh:mm (Leave data formatted as entered). When this data is copied with Set Field-script step to another time field (Format as hh:mm), it is, as expected, displayed as hh:mm.

But when the user wants to modify the value in that field, it is suddenly displayed as hh:mm:ss. If you manually remove the seconds, they will not appear again if the value is modified again.

Any ideas how to get rid of the seconds in the target field would be greatly appreciated.

Jari V.

Link to comment
Share on other sites

Not sure I'm really understanding you.

If you only want the format to show hours and minutes, then select the field in Layout Mode, and change if from As entered, to the format you want for the Time.

Lee

Edited by Guest
spelling error
Link to comment
Share on other sites

Thanks Lee,

The field is already formatted as hh:mm and time is shown as hh:mm when the field is not selected.

The problem is only when you place the cursor into the field to edit the value, at that point the seconds also appear.

I hope this clarifies the question.

Jari V

Link to comment
Share on other sites

The time field type, natively has the time formatted as hh:mm:ss. You can have it display as hh:mm but the data itself will still be hh:mm:ss.

If you change the field type to a text, you can display it as hh:mm but then it wont be a time field. A better way maybe to use a calc field with text result to simply display it as hh:mm.

Link to comment
Share on other sites

Since the time field is used in calculations, changing the field format as text is not practical.

If you edit the data manually, and remove the seconds, it will stay that way (and calculate correctly), even if you exit the field and come to edit it again. Could this type of manipulation be done somehow when copying the data from the other time field?

Jari V

Link to comment
Share on other sites

Thanks raybaudi,

I couldn't make it work.

I was playing a bit more with text functions and used "Insert Calculated Result" instead of "Set Field".

Now the copy script looks like this:

Insert Calculated Result [select; MainTable::Time1; GetAsText(RelatedTable::Time1)]

This script seems to copy the time without seconds (even when edited).

Jari V

Link to comment
Share on other sites

This topic is 6335 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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