Modx assign default date to template variable - modx

I have a template variable of input type date but I'd like to have a default value of the current date at the time the document was first saved.
I've noticed that using the date formatter widget gives an option to "If no value, use current date" however it seems to use the date at the time it is being viewed rather than the date at the time the document was created.
Any help appreciated.

I think the only way to get the date when the article was saved for the first time is to use [ * createdon * ]
If there is a way to add the created date to a TV, I am not sure. I think your best shot would be to see if you have an event that you could "hook" you Template Variable, and then use the createdon variable everytime the article is saved! I am not sure this works, but This could be a possible!

Related

Powerapps time values reflecting incorrectly (often just set to default) when adding or pulling from a Sharepoint List of Date and Time values

I have a list in Sharepoint that includes the following snippet:
When I use a gallery in Powerapps, and link this list to it, the date and time display shows a different value for the time. For example, entry number 1's date and time look like this: 07/01/2022 19:40.
So the date has been converted to something else.
I don't know how to address it. Can anyone help?
Good question!
Sharepoint actually saves your times in UTC. This means that once PowerApps loads that time and corrects it to your time zone, the date and time could be different.
https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-csom/jj164700%28v%3doffice.15%29
Basically, you take the UTC time and add your local time difference, that gives you the correct one :)

Netsuite workflow condition pulling on date field was edited

I am trying to set a condition in a NetSuite workflow so it only triggers when the date of emp. Termination = today and the date that same field was edited also = today. This is what I have but it is not working:
(DECODE({systemnotes.field.id}, 'custentity_emp_termination_date',{systemnotes.date})={today}) and {custentity_emp_termination_date} = {today}
Thanks in advance!
{systemnotes.field.id} is not a real field. It implies a multi-level join (from current record to System note to Field), which NetSuite does not allow outside of SuiteAnalytics. The "Name of Field" can be viewed if you put "{systemnotes.field}" in a saved search to see how it is formatted since it'll have to be exact.
Replace the code with:
DECODE({systemnotes.field}, 'NAME OF THE FIELD',{systemnotes.date})

Resetting a DateTime-field with invalid data, programmatically

In Dynamics CRM 365:
I'm coding a plugin for a workflow, that's supposed to set a DateTime-field to a given date. The code works fine, unless the field ALREADY contains the value '31-12-9999'.
Every time I try to Update the entity's field with a new DateTime-value I get the following error:
The date-time format for 9999-12-31T23:59:59-00:00 is invalid, or value is outside the supported range.
The format isn't a problem, seeing as it works fine with any other date. I know for a fact the problem is because of the 31-12-9999 in UTC.
As soon as I try to access the field, it tries to convert it to GMT+2 (local timezone) and fails.
The question:
Is there a way to force delete/update the value in a field through a coded plugin?
I have tried with the normal organizationservice CRUD-operations but none of them work.
This should help or give ideas
https://community.dynamics.com/crm/f/117/t/237525
"the date format used for those fetch conditions has to match the date format configured for that user in CRM"

Orchard CMS Query Creation Date

I'm new to Orchard CMS and trying to create a query that will filter a list of upcoming events date. What I want to do is filter a list of upcoming events. I have set up a list and plan to use the creation date (setting the date to the event date) as filter. Where I have ran into an issue is getting the filter value to work. When I set the filter value to {DateTimeField.Date} for get the current date or any of the other date options, the filter does not work. It show all events. When I manually type in the value field "2014-08-20", it works. Any ideas of why I can not set the date to the current date?
I have also tried creating just a date field within the content definition and received the same issue as above. I do plan to create a Event End Date that will not show, but will be used to filter. I assume the value will be very similar though to what would be needed for the creation date though.
I am using Orchard CMS 1.8.0
Any help will be greatly appreciated.
The current date can be obtained in Token form like this: {Date}. That token itself can be modified as a date token. In particular, it can be formatted. In your case, because the filter will construct a HQL filtering clause from your expression, {Date.Format:yyyy-MM-dd} will put the current date into the right format.

How to get the Current Date & Time Automatically to a Date Time Field

I have created a date time field I made today's date as the default value, Then I added it to a page layout and created a page, But the current Date Time is not picking up from the system.
I dont want to give the user to select a Date Time instead it should populated automatically
Is there anyway to achieve this without writing code in code behind files?
This is very similar to this question I think
SO - How to get Date and current time from the Date/Time column in SharePoint Custom list
My answer there gives a few options such as using the built in Created field, using a calendar template, a JavaScript hack and a custom field type.
Guys, fake [Today] trick worked for us - but prob is we only got the date value not datetime.
Janis, is it possible to get date and time both from the fake [today] column trick? pls refer few articles on the same
Does [Today] work?
If you have language pack applied to SharePoint, then you must use localized "Today" string.

Resources