[Essentials] functions

[Essentials] functions

  
Forge Component
(21)
Published on 2015-01-17 by Rebecca Hall
21 votes
Published on 2015-01-17 by Rebecca Hall
Funny functions .... thanks guys
Joop Stringer wrote:
Funny functions .... thanks guys
 
 Hi Joop.

I bet you have some functions there you could add to essentials. Dare to join the Team? ;)
Hello there folks!

I usually create a custom function to return the length of a trimmed text, calling it TrimmedLength.
Input:
  • t - text to evaluate
Output
  • Length - the length of the trimmed 't'

Hope it helps,
--
R. Saraiva
Hi Saraiva,

Sounds like a cool add-on to the component. Just join the team to share it with the Community!

Cheers!
Hey guys ... not to be offensive, but a lot of the date/time format functions are already in the text.xif

Formats a DateTime by replacing the allowed keywords with their values.
Available Keywords: 
[yyyy] - Represents the year as a four-digit number; 
[MM] - Represents the month as a number from 01 through 12; 
[MMM] - Represents the abbreviated name of the month; 
[MMMM] - Represents the full name of the month; 
[dd] - Represents the day of the month as a number from 01 through 31; 
[ddd] - Represents the abbreviated name of the day of the week; 
[dddd] - Represents the full name of the day of the week; 
[hh] - Represents the hour as a number from 01 through 12; 
[HH] - Represents the hour as a number from 00 through 23; 
[mm] - Represents the minute as a number from 0 through 59; 
[ss] - Represents the seconds as a number from 00 through 59;
 
Hey Joop!

No offence taken!

As a member of team, you're most welcome to trim what is no longer needed, or at least add a reminder that they will be discontinued!

Will you? ;)

There is some built-in function like "DayOfWeek() (Returns the week day of 'dt', ranging from 0 (sunday) to 6 (Saturday))" but to get the name of the day of the week instead of the number?

You can use Format_DateTime function at Text extension with "ddd".

Check https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/Text_API#Format_DateTime


Jogait wrote:

There is some built-in function like "DayOfWeek() (Returns the week day of 'dt', ranging from 0 (sunday) to 6 (Saturday))" but to get the name of the day of the week instead of the number?



OK, but that doesn't support translations right?

Jogait wrote:

OK, but that doesn't support translations right?

The Text extension is using the C# date formatter libraries.  It could pick up the users locale automatically but it would need to be tested.  Language translations haven't been added to the Essentials application so it probably doesn't translate anything either.