New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
U4-7301 - Extend datepicker options #984
Conversation
Add config options for pickDate, pickTime and useSeconds.
Set value of pickDate, pickTime, useSeconds, useMinutes based on format property.
.. didn't seem to work on localize element.
localizationService.localize("content_invalidDate").then(function (value) { | ||
$scope.errorMsg.invalid = value; | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error messages wasn't localized .. maybe we can use a similar approach for the other property editors?
<div ng-repeat="day in weekdays"> | ||
<label><input type="checkbox" name="weekdays" checklist-model="selectedDays" checklist-value="day.id" /> {{day.name}}</label> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the weekdays prevalues doesn't need to be specific datetime picker?
Probably other might want to use this as well? .. I store an array of the selected days, where Sunday=0, Monday=1, etc... but they can of course just link to this view in datepicker folder.
@bjarnef are you waiting on @Shazwazza to clarify some of this before it's ready to be reviewed or do you wish for me to review it in it's current state? |
@warrenbuckley you are welcome to review, but there is a few issues with setting min and max date. It seems when I enter a date format in PE config, it re-format it on save? maybe moment.js does something there? Let me know if I should change more on this. |
@bjarnef Yes before I can review this properly, I suggest that you try to complete this & ensure you have tested the different scenarios. Moment.js is great for dealing & working with dates & I recommend using it if you need to or need help with date formats & locales etc. This is shipped int the core of Umbraco. With dealing with some stuff with date pickers in forms, I know there can be a lot to test. I would recommend you ensure that the following works:
Note Locale: However ensure the correct date format is saved/sent to the DB. We are only interested in changing how the date looks when picked |
Okay, will check this. |
Furthermore for publish at and unpublish at I think they need a separate instance of datepicker as they always should use a full datetime picker. |
@bjarnef is that the problem that is causing you a problem to finish this PR? |
A little as in think I think moment.js want the date format in English, e.g. I think it was re-formatted in Danish date format from prevalue input.. It is a while ago I last had a look at is, so need to take a look at it again :) |
OK look forward to seeing your updates, I will try to help where I can to help achieve your goal with this :) |
…v-v7-U4-7301 Conflicts: src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html
@warrenbuckley I have merged latest changed from dev-7 into this branch. So we have these properties for datetime property editor. The date format If I enter these dates for minimum and maximum dates: then after save they somehow is changed to this format (danish datetime format): Do you know how we handle these correctly? .. I think moment.js understand datetime format in other locales, but it then the culture/language/locale passed in - otherwise it might use a wrong date or can't convert it to a datetime if e.g. it think 31 is the month instead of the day. http://momentjs.com/docs/#/parsing/string-formats/
We might be able to use something like this:
but I am not sure which format of the dates in config to expect. |
Some other things to consider/test.
|
Since I can enter any date time doesn't like HH MM mm yyyy, will your code take this into account to determine if time is required? |
(sorry typo above... Writing on my phone but you get the idea) |
Hi Bjarne, It's a shame that this has stalled for almost two years now and plenty has happened since then to the datepicker. I think changing it so it supports more options still has a ton of merit but I would encourage you to start fresh instead of us trying to puzzle all of this back together again. I'll close this PR but it will be good to refer to if you decide to try this one again. We're working on a much better process of dealing with PRs so it won't stall like this any more. Many thanks for the effort and cooperation and hopefully we'll see a new PR related to this! |
Hi Sebastiaan Yes, it has been a while since I was working on this :) Maybe we should have a datepicker prevalue editor, which property editors can use similar to the property editor. This could be used for setting minimum and maximum dates in the datetime property editor, but also for other custom property editors. |
PR for http://issues.umbraco.org/issue/U4-7301
It extend the datepicker with use of more properties and also make it possible to use it just as a timepicker.
There is a few issues that need to be fixed or considered.
HH:mm
will set pickDate=false, pickTime=true, useSeconds=false, useMinutes=true