12
Views
7
Comments
Solved
Function to formatting an input fieldfor semester of the year?

Hey folks, 

Is there any buit in function for date when it returns the semester of the year? 

for exemple I need a return of [Year-semester-Id] in one input to persist the return in text to the data in the database.

I was searching in the buit in functions documentations and I didin´t find any solution.

Than u all.

2025-01-09 14-56-57
IQ78
Solution

Isn't it jan- jun = 1?

Create a server action with an output of type text:

and assign the output:

that's it!

G'Luck!

2022-12-03 22-44-14
Olliver

2022-12-03 22-44-14
Olliver

I think I did something wrong? I used a client action instead to not get a call to the server.

2025-01-09 14-56-57
IQ78

Not, clear, can u give an example.

IF it is like 

2022-01-1

2022-02-1

and it is a dropdown, u can create your own:

something like:

select...

union

select..

regards


2022-12-03 22-44-14
Olliver

Yes it is,

first semester jan-jul = 1 and second semester ago-dec = 2;

the return function is a code data text that concatenates "Year" + "-" + "semester" + userid (whith 4 number caracteres)

to field a form code to persit the code in the database.

2022-1-0001

2022-2-0034

Thank u


2025-01-09 14-56-57
IQ78
Solution

Isn't it jan- jun = 1?

Create a server action with an output of type text:

and assign the output:

that's it!

G'Luck!

2022-12-03 22-44-14
Olliver

2022-12-03 22-44-14
Olliver

I think I did something wrong? I used a client action instead to not get a call to the server.

2025-01-09 14-56-57
IQ78

yes, the brackets .. ")" not after 6, but after currdate()... and also you miss the comma "," before "1" .. compare with the code i write ... yours is only syntax error...

i put the Semester.oap to compare, regards 

Semester.oap
2022-12-03 22-44-14
Olliver

Thanks my friend, I though it was an issue with the text function.

My apologies, it was late ⏰ and I was also too tired. Thanks again to send me the oap.

best regards, 

Oliver.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.