How to validate year value in datepicker? - jquery-ui-datepicker

Description:
I'm using Jquery datepicker in my application, and also user is allowed to enter date by keyboard. Everything is working fine but when user enters 000 or 0000 as year then my code is breaking , because there is no year having value '000 or 0000'.
So, I want to validate value entered by user, specially year value, b'coz date picker is validating date and month and giving an error accordingly but it is not validating year value.

Related

Multiple conditions to see users

I need to go through two conditions here, looking for Employees who have passed with the below conditions:
If 'Passed' from 1 week of enrolled date
And the user is among the TOP 10 of overall performance percent or passed all quizzes in the past 12 months
Capture 2.PNG
I have created a new column to give me the 7th day from the enrolled date which will show me if the user completed it before this date and want only those users who completed it between the 7th day of enrolled date.
7th Day of Enrolled Date = [Merged] + 7
Now I need to know who are those users who did it...may be another column with Yes or No and filter only those which have 'Yes'??
Can someone please advise on how I can achieve this?
Thank you!

AWS Quicksight: Display week as a number, grouped by month and not year

I need to display Week as number in AWS QuickSight.I understand, we can do this to get the week numbers: In the field wells, click the format option for the date field and on the left side-panel, enter 'w' in the Custom format field.
The issue is this gives the week number in the year. How do I get week number per month?
You can use calculated fields to calculate it.
It depends how you define "week of month". In a simple case, if you define first 7 days of a month as "week 1", the second 7 days as "week 2", etc, use this formula:
dateDiff(truncDate('MM', mydate), mydate, 'WK') + 1
I do a date-diff (in weeks) between first day of month (truncDate) to input-ed date.
Result:

Default Date on Slicer & custom selection

I have a date slicer which should show last 12 days as selected when report opens. Further, user should have flexibility to select any other date range.
enter image description here
Can you try Relative Date option for the date slicer as shown below image-
In this case, you can select last 12 Days in the slicer while publish. User can then switch to any other date range as per necessity. But while initial loading, report will always show last 12 days in the selection.

Extracting day in a new field from a date in Pentaho

I have a field with a date in yyyy-MM-dd format, I want to extract the day only, for example, if the date is 2014-01-25, I want to have "25" in a new field. I used step "Calculator" is calculation "day of month of date A" but I get 1970-01-01 01:00:00 for all records.
Could someone tell me what might be the reason?
Before you actually have the Calculator step, have a Select Values step and make sure the date field is Date by explicitly giving the Date data type and specify the format it is currently in.

Check if day is valid for selected month Django forms

I have a form where the user types a day (number between 1 and 31) and then selects a month from a list and then types a year.
The problem is that when a date such as (31 February) will throw the following error:
day is out of range for month
Is there a way I can check if the day is valid for that month (and year if it is a leap year) in the form?
If you use django Forms check SelectDateWidget
btw, why don't you want to catch such errors and show above your form in other words (if you allow to choose and submit 31 and 'February')?