Using date picker as filter in django admin - django-admin

How to get date picker in Django Admin Filter?
using simple list_filter will get me text selection: Any date, last 7 days, last months etc. But I want simple datepicker, so i can choose just one date... I found django-admin-daterange but I don't need range - just ONE date..

Related

Adjusting Tableau Date Values to per month

I'm looking to adjust the basic Tableau time frame from the ISO/Gregorian format to a customized one. Currently, I'm displaying data in a line chart by Month and week. The week format is based on 52 weeks ie 'Week 43' = 10/17-10/23. I would like to display the week time line relative to its given month ie the column would read October 'Week 1' = 10/01 - 10/07, 'Week 2' = 10/08-10/14 and the following month would reset the weeks to start at zero. Is this achieved by a parameter?
There are a few features in Tableau that will help you with this.
Read through the on-line help about creating custom dates, setting fiscal years for date fields. The custom date feature is based on the Tableau function DATE_TRUNC() so you might want to read about that as well.
The short answer though is - right click on your date field in the data pane on the left margin, then set the fiscal year start under the default properties and create a custom date at the week level. You want to create a date value, not a date part.
Then use your custom date to build your viz, and change it between discrete and continuous depending on how you want to present your values.

how to create DateAndTime picker in swift 4 which so that user is able to select date and time both

I have implemented the iOS date and time picker is my project like this
but the problem here is that is user want to select year and month then there is no option. how to solve this I can not find any library.
I want a date and time picker from which user can select date year, month,day and time hh:mm ?
You could use the UIPicker class to implement your own date an time picker. It would have year, month, day, hour, minute, and possibly AM/PM sections. You'd need to build some intelligence around changing the available days depending on the month (different months have different numbers of days, and on leap years February has a different number of days than on other years.)

Can Year Constraint removed from the native DatePicker in ios

I am Building an app and I want DatePicker to only Show Month and Day, but not the year. Since Native DatePicker shows Day, Month, Year. Can year be removed from the native DatePicker or is there any way by which we can let the DatePicker show only day and month and not year.Somebody's having any Suggestions? Thanks in advance.
Currently the only available date picker modes are
typedef NS_ENUM(NSInteger, UIDatePickerMode) {
UIDatePickerModeTime,
UIDatePickerModeDate,
UIDatePickerModeDateAndTime,
UIDatePickerModeCountDownTimer
};
So no, if you want to select an actual date the year component always shows. You could however, try to use a regular UIPickerView and update the amount of days in the first component whenever the month changes, although I would not recommend doing so.
What do you need the date picker without a year for, after all?

Create a date range dropdown with Ransack

I'm using Ransack for some simple searching of one of my models.
I would like to add a dropdown to the search with entries like 'Today', 'Yesterday', 'Current week', etc which would operate on the created_at field. Also it would be nice to have an entry in this dropdown to reveal 2 date boxes to pick a custom date range. How do I go about this?
One way that I can think of doing this is for the dropdown to populate the two (hidden) date boxes via JavaScript, I just don't know how I could easily reselect the proper entry in the dropdown when reloading the page.
use this
distance_of_time_in_words(obj.created_at,Time.now)+" ago"
This will return result like this:
about 2 hours ago

UIdatepicker showing weekdays

I would like to make a datepicker that shows weekdays, date and month.
I got a working datepicker showing month, date and year but I would really like it to show month, day, date
How is this possible? I know I might have to make a custom UIpicker, but how to I make this refer to dates?
You need to create your own picker with a UIPickerView. Create an NSDateFormatter. You can then access the month names and the weekday names from the date formatter. An NSCalendar can be used to obtain the maximum number of days for a month.
The real trick is updating the picker view components as the user selects a value from one of the components. For example, if the user picks a month, you want to update the number of days shown in the day component (or, like a UIDatePicker), grey out invalid days. This is complicated by the fact that you don't have a year so there is no way to properly handle February.
And what do you do when a user picks a given weekday? How should this affect the selected day? Just things to consider.

Resources