Jump to content

Search the Community

Showing results for tags 'time'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Caspio Bridge
    • Caspio Apps for Ukraine
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL






Found 19 results

  1. Hi, I can't figure out how to allow someone to enter time in a Submission form. If I set the field to Date/Time, then I must enter a valid date, but I want to enter time only. I am also hoping there is a smart feature that can interpret/parse "8pm" and "815." thanks
  2. I am building a report and want to create a virtual field which shows the result of subtracting one time/date field from another and then sums the times at the bottom. Ie this is for calculation the time taken to enter data for each record. Can anyone advise me on code for this?
  3. Hi, I have a Calendar/Tasks table that stores a date for either an appointment or a task due date. I need to add a few functions and was hoping someone might have an idea of the best way to do this: 1) I need to add a Time selection for a calendar event. Meaning the user selects a date like normal (using the date picker) to put into a date/time field (the 'Event_Date' field in this case) but ALSO can select a time for the event (like a normal calendar like iCal or Google Cal). I know I can create a text field and use a lookup table for all the times (like 2pm, 2:15pm, 2:30pm, 2:45pm, etc.) and store it that way. My question is, can I use a text field that stores a time like this (i.e. "2:45pm") to perform calculations in a formula to get how many days/hours/minutes the current date/time is from that stored date/time? Or does that time data need to be in a specific format or included in the 'Event_Date' value (which is a date/time field). 2) What I'm trying to do is allow the user to do something like set an appointment for a date/time like 4/15/2020 1:30pm and also select a 'notify me' value like "2 days before" or "3 hours" before and then use the Automated Tasks feature to send an email/sms reminder to the user. 3) The last issue is how to store the date/time of the event because Tasks runs on UTC time and my users are all over the globe. So if a user in California puts in "4/15/2020 1:30pm" it's not the same date/time value as someone in Australia, in terms of the Tasks trigger firing. Maybe convert the users local time to UTC after they input it? Not sure of the best approach but to the user, it needs to be viewed/entered as local time (not UTC values) so it's understandable. I wish Caspio had a full calendar like this, built in, as these features are an integral part of most user needs. But if I can build it myself that'd still be great. The first 2 issues to me are the most important, though, so if anyone has some advice on this, or how to get the result I need (a normal calendar with times and notification choices) I'd really appreciate it.
  4. Hello, I have a number field ('Qty') in a submission form that is for recording the quantity of hours worked. So for example if someone worked 1 hour and 15 minutes the Qty value would be entered as 1.25. A new option I put in the submission form is a Start_Time field and an End_Time field (both Date/Time fields). A button running js puts the current date/time stamp in the Start_Time field and then when the user is done they click a button to put the new current date/time stamp in the End_Time field. The difference between the two are the minutes worked, put in the Qty field via CalculatedField setting: Datediff(minute,[@field:Start_Time],[@field:End_Time])/60.00. This seems to work well so far. What I then need to do is Round Up to the nearest 15 minute value. For example, if the calculation for Start_Time 12/31/2019 11:45 and End_Time 12/31/2019 14:10 returns 2.416666 I need it to round up to 2.5. I've tried various Round() scenarios but can't get it right. Basically, I want the Qty value to always be a version of .25, .5, .75, 1, 1.25, 1.5, 1.75, 2, etc. Does anyone know how to use Round in the calculation above to do that? Many thanks!
  5. I want to be able to search a table according to the criteria of a “From Time” (greater than equal to) and a “To Time” (less than equal to), the problem is that there is no option for Time, only Date AND Time. The result should be ALL records from all dates between the specified time. Eg. Created on (Timestamp) From 06h00 To 08h00 à display records created between 06h00 and 08hoo across all of table history. Currently I am using a submission form with a virtual field to pass the parameter to the search form. I have one Timestamp field and three Date/Time fields I wish to search. Is there any way to setup a criteria with only a time precision?
  6. Hi! I am trying to create 8 Date/Time fields where the user inputs Date, Hours and Minutes in separate fields. I found some JS that works on combining the input, but it only works on combining one set of the three fields to on Display Field. This is the code that I put in the Footer: <script> //Created_On_From document.getElementsByName('Submit')[0].onmouseover = function(){ var date = document.getElementById('cbParamVirtual11').value; if(date == ""){ date = "00/00/0000"; } var hour = document.getElementById('cbParamVirtual26').value; if(hour == "") { hour = "00"; } var minute = document.getElementById('cbParamVirtual27').value; if(minute == "") { minute = "00"; } document.getElementById('cbParamVirtual49').value = date + " " + hour +":"+ minute; }; </script> <script> //Created_On_To document.getElementsByName('Submit')[0].onmouseover = function(){ var date = document.getElementById('cbParamVirtual18').value; if(date == ""){ date = "00/00/0000"; } var hour = document.getElementById('cbParamVirtual33').value; if(hour == "") { hour = "00"; } var minute = document.getElementById('cbParamVirtual32').value; if(minute == "") { minute = "00"; } document.getElementById('cbParamVirtual48').value = date + " " + hour +":"+ minute; }; </script> Any help would be appreciated...
  7. I have report which shows that list of the trips of my drivers. Currently, I have two shifts for my drivers- Morning (7am-7pm) and Night (7pm-7am). My issue is I want to show a report where, when my night shift driver searches all his trips for a specific date, it will show me all the trips made from 7PM of the chosen day until 7AM of the next day. I am hoping for your assistance.
  8. Years ago I added some JavaScript to my forms to prevent clients from selecting a "due date" that isn't at least two weeks in the future. Recently that code has stopped working, and all submissions are allowed through, regardless of the date selected. I think this may be tied to the recent Caspio updates. At least, that's all that I can see; the forms themselves haven't changed. Below I'm pasting my JS, which resides in the footer area of my forms. Any ideas would be greatly appreciated. Thanks! (BTW, I know two weeks is 14 days, not 13. But my users don't seem to recognize that, so I made this small allowance.) <SCRIPT LANGUAGE="JavaScript"> function check_date() { var entered_value = document.getElementById("InsertRecorddateNeeded").value; var entered_date = new Date(entered_value); var two_week_date = new Date(); two_week_date.setDate(two_week_date.getDate() + 13); if(entered_date < two_week_date) { alert("Must be at least 2 weeks in future"); return false; } } document.getElementById("caspioform").onsubmit=check_date; </SCRIPT>
  9. I have a details data page form on which records can be edited & updated. I would like to allow editing for all records not older than 2 days & then make the data page view only for records older than that. Can someone assist with a method of achieving this?
  10. I'm normalising a large Table which can extend to 3-4 million rows. One of the fields is 'Year' (eg '2017'). There are up to 80 different years in the database and obviously many are repeated many times, Is it worth indexing this field? I can make a table with a primary key and the related year, such as y1 = 2000, y2 = 2001, y3 = 2002 and so on, then relate the primary key to year field in the main Table. I'm just wondering whether all this fuss for so little is worthwhile. Is it going to make a performance improvement? Or should I be doing this a completely different way. Thanks for any advice
  11. Hello, I'm having difficulty with my time formula for a specific scenario. It is working correctly but producing too much time in some instances. I'm using a calculated field with the following formula to find the total time worked each day: cast (Datediff(hour, [@field:Start_TIme], [@field:End_Time])%24 as varchar)+' hours,'+ cast (Datediff(minute, [@field:Start_Time], [@field:End_Time])%60 as varchar)+ ' minutes' The formula is working when: The time calculated is more than an hour (i.e. 2:00 PM to 4:45 PM) = 2hrs, 45 minutes (CORRECT RESULT) or The time calculated is less than an hour but within the same hour of the day (i.e. 2:00 PM to 2:23 PM) = 0hrs, 23 minutes (CORRECT RESULT) The formula is NOT working when: The time calculated is less than an hour across DIFFERENT hours (i.e. 2:50PM - 3:05PM) = 1hrs, 15 minutes (INCORRECT RESULT) The hour should be '0' as the total time worked is '15' minutes only. I'm not sure if I can build a condition into the already existing formula(s) or if a new formula(s) is required. The standard datediff function also produces the same result. I've tried other code located online but have not been successful at removing the hour that appears in error. I've searched the CASPIO forum but was not able to locate a like issue. Any help or suggestions would be much appreciated. Thank you!
  12. Hello everybody, A simple question which is haunting me for a couple of days now. I have a table MEMBERS (where all my members are listed with different info. Most importantly there is one field: MemberUntil (Date Time Value) How is it possible for me to NOT allow a member to log in if the date is greater than the date under the field: MemberUntil? I have tried on VIEWS but the whole logic doesn't work. AND >> Members_MemberUntil >> Greater >> (then I have to manually input a date). I would like to be able to say: IF MemberUntil is greater than the date stated in the field MemberUntil, then this specific member will not be able to use his login details. Thank you so much for your time and consideration Cherif
  13. Need help to have a work around on how to ensure that students are not enrolling a subject which overlaps their current schedule. For example: Student A - is currently enrolled in a subject on Monday 1PM- 1:55PM. When she tries to enroll again, the system should not allow her to enroll any subject anytime between 1PM- 1:55PM on the same day.
  14. I am creating a datapage where my clients can make request for the time and date of a specific inspection. In order to be able to coordinate the inspectors I have to limit the time that the requests are made, therefore I need to create a condition that does the following: to process the request online then the request has to be made at the latest the prior business day before by 5:00 pm (local time) For example today is Tuesday at 6:00 pm local time, therefore the earliest inspection available is for Thursday since is already after 5:00 pm to request for tomorrow. I am intermediate user that have created a significant application but I don't have programming knowledge, so any help is really appreciated.
  15. Hi everyone, I have found several scripts that do not allow to submit the data if the date is too late (or too early). Is it possible to deny to enter the data, if time is too late? I mean, if the data may be added only before 10 AM, and now is 11 AM, then the data is not added and some error message is displayed? Or more simple script, if the data may be added only before 10 AM, and a user tries to enter "11 AM", then the data is not added and some error message is displayed? Thank you for your time!
  16. ababcock

    Time Sheet

    I have multiple submission forms that need to calculate total hours based on the begin time and end time entered. The script I have entered is: <script> document.getElementById('Submit').onmouseover = function(){ var date = document.getElementById('InsertRecordDate_of_Service').value; if(date == "") date = "1/1/2011"; var hour = document.getElementById('cbParamVirtual2').value; if(hour =="") hour="00"; var minute = document.getElementById('cbParamVirtual3').value; if(minute == "") minute = "00"; var ampm = document.getElementById('cbParamVirtual4').value; document.getElementById('InsertRecordStart_Time').value = date + " " + hour + ":" + minute + " " + ampm; var hour2 = document.getElementById('cbParamVirtual6').value; if(hour2 =="") hour2="00"; var minute2 = document.getElementById('cbParamVirtual8').value; if(minute2 == "") minute2 = "00"; var ampm2 = document.getElementById('cbParamVirtual7').value; document.getElementById('InsertRecordEnd_Time').value = date + " " + hour2 + ":" + minute2 + " " + ampm2; var start= new Date(document.getElementById('InsertRecordStart_Time').value); var end = new Date(document.getElementById('InsertRecordEnd_Time').value); var timeDiff = end - start; var hh = Math.floor(timeDiff / 1000 / 60 / 60); timeDiff -= hh * 1000 * 60 * 60; var mm = Math.floor(timeDiff / 1000 / 60); var totalmin= (mm+ (hh * 60)) ; document.getElementById('InsertRecordTotal_Units').value = totalmin.toFixed(2); }; </script> This is working some of the time, but not always, and I don't know what the problem is. I just submitted a record for 6/9/15 11:00 AM to 6/9/15 2:00 PM, and it came up with 185.00 hours. Does anyone know a way to make this work?
  17. Hello All!! I have a date field in which times are captured and stored some of the time. I am trying to figure out how to display the date in an HTML block in a dynamic way that displays time if present and not if empty. Please consider: Date1: 01/06/2015 Date2: 01/07/2015 17:45:00 Desired display: Date1: Jan 6th, 2015 Date2: Jan 7th, 2015 5:45PM Actual display Date1: Jan 6th, 2015 12:00AM Date2: Jan 7th, 2015 5:45PM When time is not captured it is not relevant and thus shouldn't be displayed. I have a workaround that involves a calculated field, but it's pretty clunky. Any ideas? Thanks
  18. Hello All Does anyone know how to change the submission form with a time limit (http://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-add-a-time-limit-to-submission-forms/) so as it diverts to another webpage (unsubmitted) if someone doesn't complete it in time? Currently, it submits itself automatically. Many thanks Duncan
  19. How do you configure search fields for just times and not date? Rey
  • Create New...