Smarty date_format with default - smarty

I want something like this - where the date could be empty:
{$VERTRAGSDATUM|date_format:"%d.%m.%Y"|default:'________________'}
But it gives me only "Undefined index" errors.
When changing the order to default at first it gives me the current date. :-/
I've a lot of this date fields and don't want to ask if isset... so is there perhaps a simple solution?

Related

Referencing a date from a cell in google sheets

I am trying to track stock prices with Googlefinance function in Sheets. I can pull the price for a date with =INDEX(GOOGLEFINANCE((B2),"price",date(2019,12,13)),2,2) which is fine but I want to input the date with Column A which has date data. So, (A1) instead of (2019,12,13)but for some reason I get errors.
This seems simple but I cannot get it to pull the date from my column. Ive tried removing DATE and just using the cell but this also doesnt work.
the formula that worked for me is
=index(GOOGLEFINANCE("YOUR_STOCK", "price",A1),2,2)
If, like you said, you already tried that and it did not work, you should link us a test sheet with your formula.
make sure A1 is really a date. you can check this with
=ISDATE(A1)
the output should be TRUE. your formula is correct:
=INDEX(GOOGLEFINANCE(B2; "price"; A1); 2; 2)

SSRS Cache Report Parameters Previous Week

Is there a way to set the Parameter Values in the Cache Refresh Plan window to use the previous Sunday? The field is a Date/Time field and will not let me enter code such as =DateAdd(DateInterval.Day, -7,DateAdd(DateInterval.Day, 1-Weekday(today),Today)). It is looking for date format. Thanks in advance
I'm unaware of any parameter caching options. However, you should be able to get a default value to work. Perhaps the expression below will work.
=DateAdd(dd,1- DatePart(dw, CDate(Today())), CDate(Today()))
If you still can't get it to work, another option would be to add a data set that spits out the value. You could use something like:
SELECT DATEADD(dd,1- DATEPART(dw, CAST(GETDATE() AS DATE)), CAST(GETDATE() AS DATE))

only show events who are greater than or equal laravel

Im working in a project where I display different events in my view. The goal for now is to only show events that are upcoming, so it doesn't show events that are older than today.
The users of my page can create an event and set a sertain date for it.
The data is stored into my db like this:
$table->string('datum');
In the view it return it like this:
06.03.2019
My controller to return the data looks like this:
$date = date('d.m.Y');
$evententries = Event::where('datum', '>=', $date)->orderBy('datum', 'asc')->take(3)->get();
but it's somehow not working..
Anyone got any Ideas of how to fix this and what my issue is here?
btw, I'm using laravel 5.7.
Thank you :)
Hmm you are doing it on wrong way from begin...
First: why you are using string to store date value? there is much better options to store date within database...
Second: you are using date format which cannot be compared on that way (using < > =)
when you are comparing strings ie 08.03.2019 will be always smaller than 10.01.2016 because 1 > 0... so if you are comparing dates use:
db format for storing dates
for comparing use format yyyy-mm-dd because on that way even simple string comparison will give you correct result...

Joomla article field date minimum limit

I am Building a Family site with Joomla 3.7.3 and are trying to add custom fields to the articles. I am e.g. adding the birthday of a Family member in a field. But, it seems like I cannot create a date before 1900-01-01. Do you know of a workaround for this and maybe why one would add this limit to a date field?
Note: I see that there is an option called: "minyear" in the documentation. It might solve the problem, but how do you use it?
Even though the datepicker popup only goes back to 1900, you can manually type in whatever date you want.
You can change the date format disabled by going to Language Overrides and changing the constant of DATE_FORMAT_LC4 to F d, Y or whatever format you want.
If you want to tinker with the datepicker functionality, I believe those files are in /media/system/js/

Error in retaining an invalid value for date fields in form

I am relatively new to the Spring framework and am facing a problem that I am not sure where I am going wrong.
I have a form with two date fields, date 1 and date 2. If date 1 field is an invalid date and the date 2 is a valid date, when validations are performed, the date 1 field's invalid value is not displayed. Instead the date 2 value is populated in the date 1 field box.
Could someone please tell me why and where I am going wrong.
I believe this is a framework error with the way I have configured spring and not a problem with my code. I tried debugging through my code and it works as it is supposed to.
I had the same issue. It looks like you are using a customDateEditor that is different from the one that Spring provides. Check if you are importing
org.springframework.beans.propertyeditors.CustomDateEditor
in your customPropertyEditorRegistrar class... It will probably help.

Resources