Validate Start Time With Current Date In Sharepoint? - validation

I have a column called Start Time (it's a SharePoint Default Calendar Column). I need to validate if the Start Time is less than today or not? Without using javascript? Is this possible?
I have tried this:
Created a column called Today type as Date and Time.
Default value is current date.
Then compared the Start Time and Today in validation settings like the following:
=[Start Time] < [Today]
it seems not working. help please?

Try this code instead of yours
=[Start Time]<NOW()

I use this to validate that Start Date must be less than or equal to Today:
=[Start Date]<=Today()
...and it works for me.

Related

Avoid #VALUE! on empty cells when using GOOGLETRANSLATE function

The idea is to enter a date in USA format (MM/DD) and it will automatically show the day of the week in spanish in another cell using code =googletranslate(TEXT(B9, "dddd"),"en", "es")
The thing is that empty cells are showing #VALUE!. How do I avoid this?
When using code =TEXT(B15, "dddd"), that doesnt happen, but it shows day of the week in english.
Because im using googlesheets, using code =TEXT(B22, "[$-0C0A]dddd") doesnt work to translate language.
=if(B9="","", googletranslate(TEXT(B9, "dddd"),"en", "es"))

User facing date field granularity control

I'm trying to give my users the option to select the date field granularity of their choice, such as day, week, month or year. This is normally controlled on each graph in the menu show below but this isn't available in a published dashboard:
My first idea was to create a calculated field that truncates my desired date based on a parameter that I expose through a control. This would like something like this, truncDate(${intervalParameter}, {dateColumn}). The problem with this is that the first argument of the truncDate function must one of valid string literals and will throw an error before saving if it isn't.
Does anyone know of any other ways of achieving this? Or maybe some sneaky way of getting around the error?
I figured out a work around using ifElse.
ifElse(
${intervalParameter} = 'Day', truncDate("DD", {dateColumn}),
${intervalParameter} = 'Week', truncDate("WK", {dateColumn}),
${intervalParameter} = 'Month', truncDate("MM", {dateColumn}),
truncDate("DD", {dateColumn})
)
There might be better solutions out there but this is what I've come up with.

OutSystems TimeZone Conversion

I need a hand here
The default OutSystems timezone is UTC
There's an Action called ConvertFromTimeZone(1,2,3)
1- You write the Date and Time, no problem here.
2 & 3 - You have to write the SourceTimeZone and the DestinationTimeZone, these must be written in Text data type.
My question is: How exactly am I supposed to write it?
Thanks.
you can use GetSystemTimeZones to get the list of available timezones in the servers.
This post http://www.outsystems.com/forums/discussion/16005/convertfromtimezone/#Post67485 shows the Identifier that uniquely identifiers a timezone.
Just one correction: the default timezone isn't UTC, but the timezone set in your application server.
The value you should use in the timezone code must be one of Microsoft Time Zone Index Values (column 'Name Of Time Zone')
You can find more information about timezone conversion here:
http://www.outsystems.com/forge/component-discussions/500/Time+Zone
you can use this action ConvertFromUTC(UTC_Datetime, "GMT Standard Time") it is from the Timezone extension.

Kendo DateTimePicker, after parsing the Date the Year is Incorrect

Good Afternoon Fellow Code Monkey's
I'm new to StackOverflow, and Kendo UI programming. My problem is as follows. When trying to parse the date, and everything seems to work correctly until I get to the year portion.
here is my Javascript Code
$('#datepicker').kendoDatePicker({
format: 'MM dd yyyy',
parseFormats:['M/d/yy', 'MM/d/yy', 'MM/dd/yy', 'M/dd/yy', 'M/d/yyyy', 'MM/d/yyyy', 'MM/dd/yyyy','M/dd/yyyy','Mdyy','MMdyy', 'MMddyy', 'Mdyyyy', 'Mddyyyy', 'MMddyyyy', 'M-d-yy', 'MM-d-yy', 'MM-dd-yy', 'M-dd-yy', 'M-d-yyyy', 'MM-d-yyyy', 'MM-dd-yyyy', 'M-dd-yyyy']
});
Basically I want the user to be able to type the date into the Datepicker in any format, from 05052012 to 5/5/2012, etc and then the box formats. The above code for instance when entering "05052012" returns in the box 05 05 2020. Is there something wrong with how I have the year set up?
Thanks in advance,
SithApprentice
I think I have it figured out, seems sort of silly now. Apparently it has to do with the order in which I'm passing the formats with which I will be paresing. those with yy must come at the end, and those with yyyy must come at the beginning. I really wishTelerik mentioned this in their API Reference section for the date picker. From theier examples they make it seem like the order does not matter.

JQuery function or functions for dates

I building a custom user control in asp.net where the user can enter in a date. I am already using a JQuery function that puts in a date mask in the format of dd/mm/yyyy, but I am unable to find another JQuery function(s) or one that combines all my needs.
What I am also looking for is:
1) To validate whether the date is really a date, i.e. not 31/13/2010 or anything along those lines.
2) Where I can check to see whether a date is in the past or in future based upon a configuration entry in the application.
Can anyone help me, please?
This is just off the top of my head, but you could use JavaScript's Date object http://www.w3schools.com/jsref/jsref_obj_date.asp
1) You could use one of the following
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);
Then verify that the date components are the same as entered. If you set the month to 50, it will take the year, and go 50 months forward... which seems odd, but... Just have to verify the information is what you entered. The months start at 0 for January, so when checking, be aware of that.
2) There's probably a lot of ways to do this check, but a quick thought on it is
var t = d.getTime() - new Date().getTime();
If t is positive, it's in the future, if it's negative it's in the past.
The new Date() creates a date object with the current time.
You could also use the jQuery UI DatePicker. http://jqueryui.com/demos/datepicker/
I haven't checking into the exact functionality it has that might fit your requirement, but it is another resource to check into.
HTH

Resources