Odoo fields.Date error - datefield

I am using fields.Date to enter a particular date to a field. Lets suppose I do not use the date picker and instead choose to enter the date manually, I am encountering following error.
Lets say I input 12/04/17 (mm/dd/yy) it takes it as 12/04/0017 instead of 12/04/2017.

If you want the date (year) to appear as 2 digits, you can change this in the Settings/Translations/Languages - Select Active Language - Date Format.
Change %Y to %y.
If the date is displayed as 2 digits, then entering it in manually as 2 digits appears to work.
Personally, if I try to enter a date manually with the year as 17 (and year displaying as 4 digits) I get an error.

Related

How can I change period to format date? - Quicksight

I have period date compose by 6 numbers, the first four numbers it’s the year and the last two is the month, example: yyyymm. (202201 )
The problem with this field is that sometimes changes between int and string. How can I change everything to a date format? dd/MM/yyyy
How can I change everything to a date format? dd/MM/yyyy

Dynamic Date Selection Tableau

Here is a sample data that I am working with. I want to make it more dynamic. Meaning, if a user selects a date, I need to display the 7 day, 14 day change based on the selected date. I have created a parameter with the date filter and also created a formula for 7 day change like this : LOOKUP(SUM([Sample]),-7) and LOOKUP(SUM([Sample]),-14)
I tried using these formulas, but it wont work when I filter to a particular date. Any help is appreciated.
Date Sample
7/1/22 491,556
7/2/22 74,027
7/3/22 65,938
7/4/22 74,099
7/5/22 636,580
7/6/22 508,986
7/7/22 630,481
7/8/22 495,756
7/9/22 71,503
7/10/22 64,875
7/11/22 73,174
7/12/22 642,674
7/13/22 517,709
7/14/22 638,848
7/15/22 490,698
7/16/22 68,802

Need to display first four letters of date (freemarker)

The copy editors at my job are very specific on how they want the date displayed. The code I use now works perfectly for months abbreviated by three letters. Doesn't work for Sept.
Current code:
${(.now?long - 259200000)?number_to_date?string['MMM. d']}
Is there a way to display the date as Sept xx ?

DAX - Month Name column error when dropped in value field

I have a simple date table (marked as a Date Table)
the Date column is native to it, the rest are calculated columns.
This issue will be about these of them:
Month Name = FORMAT(Dates[Date], "Mmmm")
Month = Month(Dates[Date])
Both set to "Don't summarize".
I dropped them into value field of a visual out of curiousity, and a curious thing happened - despite "don't summarize" they took MIN form of value to display, but Month Name came out incorrect.
Image 1: 3 out of 4 lines in the column First Month Name are wrong, unlike Month which is fine.
Image 2: added Date to the row fields to check - line by line it's fine, but subtotal still wrong:
Image 3: I filtered Month Name in data view for February, to see which lines are for Month value of 1 - there is none.
This is a blank new report, no measures, no filters - that's all it is.
If someone can explain why this happens, thanks in advance
The columns with "Earliest"/"First"/"Min" are summarizing because they are implicit measures in a matrix visual. Since there are multiple months in one quarter it has to aggregate somehow.
The month name is a text field, so it sorts alphabetically by default. If you want it to sort by month number instead, you can use the Sort by Column feature to sort Month Name by Month.

How to calculate date difference with XPath only?

I have a date field in the form created using InfoPath, that allows the users to enter a date, which presumably is the due date of a task. And I want to have another "calculated value" field to:
if the the date has passed, then show "overdue"
if not, then show the number of days left till the given date
Is this possible without writing VB/C# code, but just pasting an expression into the XPath dialog box?
Thanks!
Assuming this is your xml node where user enters date value
<due-date>2012-02-08</due-date>
then below xpath expression will return the days remaining for the due-date if the date entered is before the current-date and returns 'OverDue' if the entered date passes current-date.
if((xs:date(current-date())) <= (xs:date(/due-date)))
then days-from-duration( (xs:date(/due-date)) - (xs:date(current-date())) )
else 'OverDue'

Resources