Need a PDF with multiple current date fields - date

I have a checklist form I'm building in Adobe LiveCycle ES2 that our IT department uses and they need it to have Monday-Friday on it and each day needs to have a current date field that autofills and becomes read only once it is populated, but it only needs to populate that day. Basically, on Monday, they open the form, the date for Monday gets populated, but Tuesday-Friday stays empty, they come in on Tuesday and open the form and Tuesday's date is now also populated. Does this make sense? Is this something that is fairly simple? Thanks!

I am not sure whether I know exactly what you really want to achieve. If I made some wrong assumptions let me know.
You can get week day using getDay() method on JavaScript Date object. It returns int value 0-6 where 0 means Sunday, 1 Monday, .. 6 Saturday.
Assume you have one Date/Time field for every week day. To make it read-only set their type to protected (in Object->Value toolbox). In each of them put the following code in initialize event. Don't forget to adjust if condition for every field
var d = new Date();
if (d.getDay() == 6){ //checking whether today is saturday
this.rawValue = util.printd("yyyy-mm-dd", new Date());
}

Related

Quicksight datepicker for month only

I'm searching for a way to have month selection and that will serve as startdate and enddate for the date filtering.
I'm building a monthly report on quicksight, I try to use the last 31 days but that give information of multiple months
I already create date picker for those parameters but didn't find any way to limit the value to be the complete month only.
Example : if select the 12 september I desire to get the September values only (from the 1er to the 31th)
Any advice is welcome
Thanks for your help
First, add a new date filter (if you want, e.g., today to be the default you'll need to add a dynamic default against a data set that returns today)
Add a new control (I found naming this to be difficult, perhaps you're better at picking names than I am)
Add a new calculated field that returns 1 if the truncDate of your date field and the truncDate of your parameter are equal, otherwise return 0
ifelse(
truncDate("MM", {date}) = truncDate("MM", ${InMonth}),
1,
0
)
Finally, add a filter that checks where your calculated field is 1 and apply it to all visuals

How can I make a database structure in mongodb for saving the date range?

Here I'm saving the date range using golang. Suppose we have to save the all monday comes between the range of the 1-may-2018 to 14-july-2018.
How we will find all the monday between these range using golang and on the other hand we have set the start_time (8:00 A.M.) and the end_time (6:00 P.M.) of the first two coming monday in the database but on the third monday we have a change in the schedule that there is a time change like start_time (9:00 A.M.) and end_time (5:00 P.M.). Then how I will make my database to make this situation in practically using the golang.
Can Anybody help me for this to solve this solution. I made a database for and I do ppr work on it and make some fields shown below:-
Fields for Schedule //Schedule is a collection name
Id (int)
Day (string)
Start_hours (int)
Start_minutes (int)
End_hours (int)
End_minutes (int)
Start_date (timestamp)
End_date (timestamp)
How I will select monday between the selected range and how will I do the situation I explained above can anybody give guidance to me to make this situation easier. Thank you if this is a basic question then I'm really sorry.
I'd make something like this.
Find the first Monday date from the date range (see for example How do I get the first Monday of a given month in Go?
Mondays happen every week, so you can easily find the rest of dates by adding 7 days till the end date
Store all the Monday dates you found with the start and end times
I wouldn't bother with hours and minutes as you can easily get them from the timestamps in Go. Here is the simplified DB structure I would make
Fields for Schedule //Schedule is a collection name
Id (int)
Day (string)
Date (timestamp) // the actual date
Start (timestamp)
End (timestamp)
You don't need any more fields. You can get the day of the week (Day (string) in your structure, e.g. Monday) from the Date field too, but I believe if you want to query the collection by different days, this might speed things up, but be careful if you need to adjust for time zones. If you work with more than one, then store everything in UTC and you may have an extra filed Timezone, cos a date could be Monday for one zone and Sunday for another.
So, the Schedule will hold weekdays and start and end times for each of them. I'm not sure if you need to store initial date ranges, the Schedule collection will hold that range as well, form the first record to the last one. In my mind, I'd initially populate the collection with a given date range, then later on, I can modify it by adding new days, or deleting them.
When you query this collection with some start and end date range for the Date field, if your first result comes newer than 7 days from the start, this means you miss 1 or more entries from the start. If the last result comes older than 7 days from the range end, this means you miss some entries prior to the range end.
There is nothing specific to Go, in my opinion, Go works well with dates and you don't need any special date structures in your DB.

Is Date Between Two Dates SharePoint

I have a list that tracks activity for my team. Everyone puts their information in with a Start Date and Due Date. On the first day of every month I pull a report to see what was accomplished in the previous month. Nothing is ever deleted from the list so there are activities from a year ago in there. I would like to export a report of only activities from the previous month. I have tried to create a view for this and another column that would populate yes or no depending on whether the last month fell between the start and end date but neither worked.
ex. for the month of September YES indicates I want it in the report, NO I do not want it in the report
Case 1: Start Date = 9/2/16, Due Date = 9/30/16, YES
Case 2: Start Date = 9/16/16, Due Date = 10/5/16, YES
Case 3: Start Date = 8/7/16, Due Date = 9/14/16, YES
Case 4: Start Date = 6/6/16, Due Date = 7/7/16, NO
Case 5: Start Date = 10/1/16, Due Date = 10/12/16, NO
The calculated column I tried to create as a quick fix for looked like this
=IF(OR([Start Date]>=9/1/16,[Due Date]>=9/1/16),"YES","NO")
I then planned to filter it on YES. I know that's not a good code for the long run but I am by no means a SharePoint expert so I was just trying to figure something out as a sort of band aid.
The problem with your code above Is that you will need to update your formula everytime you want to use the view.
You want a formula similar to the one below so on the first of every month it should relate correctly
=IF(OR((MONTH([Due Date])=MONTH(TODAY())-1),(MONTH([Start Date])=MONTH(TODAY())-1)),"YES","NO")
Cheers
Truez

Crystal Reports default value for parameter

I'm attempting to make the parameters for a Crystal Report more user-friendly for a client, who has requested that they be able to have the default values for a Start and End date parameter be the first and last day of the previous month.
I know how to use either a formula in CR or a stored procedure to produce these values, but I want to know if a variable can be used in the 'Default Value' setting for a parameter, or if it only allows for static entries. Does anyone know? Right now the user can set the date parameters to null and the stored procedure generates the data for the previous month on its own, but I thought it'd be nice if the date parameters actually displayed the dates that were being used as defaults. Thanks in advance!
You can do it, Try below process:
Create a parameter ?date with String datatype and take static and write two default strings as below:
First day of previous month
Last day of Previous month
Now go to record selection formula and write below code:
if ({?date}="First day of previous month") then
table.date=DateSerial(year(currentdate),Month(Currentdate)-1,1)
else if ({?date}="Last day of previous month")
then
table.date=Cdate(DateAdd("d",-1,DateSerial(year(currentdate),Month(Currentdate),1)))

How to determine if a user has entered only date or also time in the form field?

I have a field where user can enter only date or also time in a text field. Now I know if I make 2 fields, one for date and one for time, I can check if the time field is empty or not.
What I'd like to do is have only one field. If user puts the ending date it takes time only, if user inputs date and time it takes both.
The problem I have is this: If user enters "8.12.2013" it in fact means "8.12.2013 0:0:0" where I convert it to Cdate. But then the end time is the first second of the date 8.12.2013 which means it 8.12.2013 means stop on that date (this is a stop time field). But in fact if a user writes 8.1.2013 it means roll till the end of the day.
Of course I can do date()>"8.12.2013" and it will work, but then if user enters date and time it will not work as it strips time part.
My question: Is there any function in ASP that would check if the time part of the date is set in a variable? I tried to use TIME but it shows 0 for hours, 0 for minutes and 0 for seconds even if the Cdate("8.12.2013") is used. I'd need the function to tell me that the time is not set so I could make a comparation using date() instead of now().
I hope that makes sense.
You could try something as simple as:
If CLng(myDate) = myDate Then ...
Dates are treated as time past a particular date etc., therefore integerising the date will remove the time.
-- EDIT --
Just to add to the above code: The CLng will convert a Date and Time into just a Date. By comparing this against the whole date you can see if any fractional part was included.
Please be aware that this would be considered bad practice in a strictly typed environment, such as .NET, but Classic ASP types are variants and are quite malleable.