Flex calendar minimum date & age validation - actionscript-3

I'm wiring up a flex registration form, and need to setup a minimum age for registration of a new user of 16 years old. I see the flex calendar component has the option for date ranges and minimum year, but I didn't readily see anything in the attributes for setting a required parameter for selected to be at least 16 years prior to today's date.
What is a good way to setup a calendar validation condition for D.O.B. required to be at least 16 years prior to today?

"flex calendar" - custom component or "DateChooser" ?
you can calculate dates via pure AS3 like:
get current date -> then set the component range(s) or just compare current date - selected date :)
What is the best way to calculate Age using Flex?

Related

How to get total and current numbers of Google Workspace Business Starter licenses using customerUsageReports.get

Please tell me how to get total and current numbers of Google Workspace Business Starter licenses using customerUsageReports.get (https://developers.google.com/admin-sdk/reports/reference/rest/v1/customerUsageReports/get). When I request accounts:gsuite_unlimited_total_licenses or any kind of license (https://developers.google.com/admin-sdk/reports/v1/appendix/usage/customer/accounts) I always get an empty report.
You are a legend mate!
The reason you get no response is because usage report is huge and takes time to generate, therefor is about 2 days behind.
So simply, use the "date" parameter to be atleast 2 days back from the day you run the report.
GET https://admin.googleapis.com/admin/reports/v1/usage/dates/{date}
That would be the following format
Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd.
We recommend you use your account's time zone for this.
Reference : https://developers.google.com/admin-sdk/reports/reference/rest/v1/customerUsageReports/get

Replacement for datepicker in TV OS

UIDate picker is unavailable in TVOS. How to select date and time is there any alternative to select date and time.
This answer focus on Swift - however, similar methods are available in Objective-C.
Since Apple does not provide a date picker for tvOS, there is no standard solution.
However, some possible steps would be:
Design and implement a UI for manipulating the date components (= year, month, day, hour, minute).
Keep track of the currently selected date, e.g. using a stored property. A date label can be updated using property observers (e.g.
didSet).
Implement methods for manipulating the selected date - component by component - and connect them to the UI.
Remember that dates and date calculations are complicated(!), so use the provided date concepts and methods - have a look at Calendar and DateComponents in the documentation.
There, you will find useful methods, for example:
range(of: Calendar.Component, in: Calendar.Component, for: Date)
can be used to find the number of months in a year, days in a month
(and so on).
dateComponents(Set<Calendar.Component>, from: Date) and date(from:
DateComponents) can be used to convert from dates to date components
and vice versa.
Further, isValidDate(in: Calendar) can be useful to check that date
components form a valid date in a certain calendar.
Below is a link to the user interface (with UISegmentedControls) that I developed for my app, however, other solutions are possible.
User interface with segmented controls.
In my case, the date picker is presented modally after selecting a table view cell in an input form.

Prevent max date to current date

Is there anyway to prevent max selected date to current date in windows store Date Picker?
Only one solution i can think of on date changed event check selected date and reset it back to current.
Any better solution?
The DatePicker class (Win10) has a MinYear and MaxYear property. If you want to have it more fine-grained you need cope in the OnChanged.
Martin

Set a minimum and maximum date in a calendar component flash cs6

I am trying to customize a date picker to be used in an application, that based on what type of person they are they are limited to a specific date range in the calendar. for example if they were type1 they would be able to select 30 days from the current date and all days before that would be grayed out and all days past the 30 would be grayed out as well. I have searched Google and not come up with anything so any help would be so appreciated.
Thanks
I'm going to assume you're using a mx DateChooser component, I'm not familiar with the calendar component in Flash CS6. Either way I'm sure the code is quite similar.
You can supply a disable date range to the DateChooser component
<mx:DateChooser id="myDate" />
All you need to do is get the current date, subtract 30 days and set that as the range end.
var d:Date = new Date(); //current date
d.date -= 30; //-30 days, yup- its that easy
myDate.disabledRanges = [ {rangeEnd:d} ] //disabledRanges takes an array of objects
//with rangeStart and rangeEnd
//you don't need a start date since you want to disable all dates before 30 days ago.
Hope this helps

How to restrict user to select date between range of Years in Primefaces?

I am struggling with primefaces calendar. I need that if today is July,28,2011 , I could be able to restrict the user to select dates in range of 1 year before July,28 and 3 years after July,28.
I looked at primefaces forum but could not found anything relevant. Please help..anyone!!!
The PrimeFaces <p:calendar> has two attributes mindate and maxdate to restrict the selectable date range on the calendar. The value for these attributes can either be a java.lang.String or java.util.Date object.
Example:
<p:calendar mindate="07/27/2010" maxdate="07/28/2012" value="#{indexBean.date}" mode="inline" />
You can calculate the mindate and maxdate you want in your bean.
The <p:calendar> has a yearRange attribute. I think you want to set the value to "c-1:c+3" to indicate 1 year before and 3 years past the current year. I'm getting this from the PrimeFaces 2.2 Guide.