Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
6 subscribers
Views
4862 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Is there a way to check for a day of week in the user input task using the date
sswilliams
over 9 years ago
Is there a way to check for a day of week in the user input task using the date picker on a date and time field? I need a javascript that can be used as part of an Event Rule for a date and time field. Something like:
If the datetime field is a Saturday or Sunday - show the message field, else hide the message field. I'm not using SAIL. I'm using the process modeler - designer portal.
OriginalPostID-175606
OriginalPostID-175606
Discussion posts and replies are publicly visible
0
youngcheols
over 9 years ago
You can use the weekday function in Appian as described here
forum.appian.com/.../Date_and_Time_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
In javascript you can do something like:
var aDate = new Date();
var dayNumber = aDate.getDay();
I believe this returns between 0 and 6, with 0 being sunday.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sswilliams
over 9 years ago
I need to be able to check dynamically in an user input form for a Saturday or Sunday being selected using the date picker on that date and time field. If the user selects either of these days, I want a message field to display. So I need to set up an Event Rule on the Date field. Do you have a sample of a javascript that I can use that will show a message field if the user selects a Saturday or Sunday?
Does the weekday functions do not work dynamically in a form when a user is selecting or entering a date. If so, please give me a sample expression of how this can be done. Thanks...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sswilliams
over 9 years ago
philb - Just reading your comment now. Thanks...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
janakik
over 9 years ago
Below code will help you to hide/show the message field based on the week day.
var d = new Date(window.FormAPI.getValue("dateTimeField").id);
if(d.getDay()==6) /* if day is saturday then show the message field */
{ //show message field }
else
{ // Hide message field }
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sswilliams
over 9 years ago
Thanks will try that.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel