How to perform year subtraction in thymeleaf - thymeleaf

I want set minimum date and year dynamically in thymeleaf. MInimun
date = current date -21 year I want to set this type of minimum date
value but In thymeleaf it is not possible for me I get issue to set
minimum date Year
this is my max date value
th:attr="max=${#dates.format(#dates.createNow(), 'yyyy-MM-dd')}"
my minimum date value is
min="${max -21}"
But This line of code is not able to set minimum date
I want to set minimum date year start from -21 year of current date
It shows me minimum date current date year back to 1940, But I want it
show minimum date year from 2000 to 1940.Between 2000 to 2021 dates
miss from the calender for minimum date site

Related

I am trying to calculate the fiscal year months ending with the last month for the current fiscal year in Tableau

I have created a parameter in Tableau called Fiscal Start Month and it represents an integer for the beginning month of my fiscal year which is May. The integer is set to -8. I created this calculation to show the dates in the relative time frame which should be May 1 - December 31, 2022. The "DOS" is a date field for Date of Service, and I created another calculated field called "date" for today's date:
IF [DOS] >=DATE(DATEADD('month',[Fiscal Year Start],[Date])) AND [DOS] <=DATE(DATEADD('month',1,DATETRUNC('month',[Date])))
THEN 'Show'
ELSE 'Hide'
END
When I filter my data I am getting items from May 5th and it is hiding May 1 - 4. Can someone help me understand why this calculation might not bring in the appropriate dates?
I tried the formula above and this is what I am expecting
enter image description here

Sheets Get value from the earliest/latest date and time from column

I have a table that is filled with dates and values.
I have 2 columns. One with date in format YYYY-MM-DD HH:MM:SS. Another with percentage number.
I need to automatically calculate the difference between the last value (percentage number) in month (date and time, for example 2021-03-11 22:55:00) and first value (percentage number) in month (date and time, for example 2021-03-10 03:04:00).
Also I need to automatically calculate the difference between the first value (percentage number) in current month (date and time, for example 2021-03-11 22:55:00) and first value (percentage number) in previous month (date and time, for example 2021-03-10 03:04:00).
He is the table
https://docs.google.com/spreadsheets/d/1_zxoGv02ki1qYdngMP28QGc0VxA3BfNzn7vyX1yA0q8/edit?usp=sharing
With red I highlighted desired values. With yellow needed result.
Last Date - First date
First Date - First date
You can use a mix of FILTER(), MAX(), MIN(), and EDATE() in this case.
For Last Date - First Date, you can try using this formula:
=FILTER(B:B, A:A=MAX(A:A)) - FILTER(B:B, A:A=MIN(A:A))
As for the First Date - First Date, you can try using this one. This works on the sample sheet that you've provided:
=MIN(FILTER(B:B, A:A > EDATE(MIN(A:A), +1))) - FILTER(B:B, A:A=MIN(A:A))

DataStudio: Get Date Range

I'm trying to calculate an average per day within Data Studio. This should be based off the selected date range.
Is there any way to get the currently selected date range?
So, if "last 30 days" is selected: 30, last quarter: 90 etc. etc.
To get the number of selected date range, you can use count(Date) in metric.

Display Year, Month and Date in sequence on DateTimePicker iOS

Here is my situation, Current Date picker is showing date, month and year in sequence of Date, Month and Year OR Month, Date and Year. But I want to display this sequence as Year first then Month and at last Date.
I searched a lot but same question I found in Javascript but not in iOS, I also searched in Apple Documentation but I didn't find any solution.
How can I achieve this sequence Year, Month and Date? If there any property or method available for DateTime Picker? OR Do I need to use custom picker? if any then which?
Thanks.
The order of year, month and day is depending on the picker's locale.
Eg.
datePicker.locale = NSLocale(localeIdentifier: "zh_TW")
will have different order from
datePicker.locale = NSLocale(localeIdentifier: "en_US")

It is possible to change or disable Date validator in jira

I change calendar javascript to Hijri, But another problem comes up. It seems that a class (DueDateValidator.class) try to validate input date, while the number of days in month is different to georgian calendar. for example we have 31 days in second month of year but in georgian (february) it is 28 or 29.
I don't think there is an out-of-the-box option to cancel Jira's date validation. You could overwrite Jira's date validation, but I think it will be easier to use a Free Text Field custom field that will hold the date as a string. Then, add to the field js code that will hide this field and copy it's date to the date field.
To keep the right order when searching for issues, you can either use date mapping to keep the georgian calendar up to date, or store the dates in a sortable way (for example YYYY/MM/DD/HH/MM - 201302161334) and order the results according to this field.
UPDATE
Simple example for Jira version 5.2.6, this will copy the text from field id customfield_10001 to the created field:
AJS.$("#create-date").text(AJS.$("#customfield_10001-val").text().trim())
To search easily keep another text field and save the date in the following format :
year month day hour minute
All in digits. for example, today's Gregorian date would be:
2013 02 267 10 26
than, when searching for issues, for example to find issues created after today's date:
custom_filed > "2013 02 267 10 26"
that sorting will work since it will sort issues first by year, than month, day, hour, minute.
I stored date in text field by creating new custom field in system-customfieldtypes-plugin.xml filed but In search it only accept exact text not > or <
custom_filed ~ "2013 02 267 10 26" It is acceptable but
custom_filed > "2013 02 267 10 26" shows jQL error.

Resources