Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lucio 24 posts 142 karma points
    Aug 15, 2016 @ 10:30
    Lucio
    0

    Date Range Picker

    Morning!

    I need some multi date range picker for a site. I have just found a package from Dan Diplo which together with Archetype looks to sort it but I have two concerns about it.

    1. Is this package available in NuGet? I cannot find it.
    2. Is this Data Type working ok for Umbraco 7.4.3?

    Hope someone can help me.

    /Lucio

  • Lucio 24 posts 142 karma points
    Aug 18, 2016 @ 13:04
    Lucio
    101

    Just to close this. I finally installed the Date Range Picker and I used Archetype to have multiple entries: enter image description here And I created an extension to get the date ranges:

    public static List<DateRange> GetDateRanges(this IPublishedContent node, string alias)
        {
            List<DateRange> dateRanges = new List<DateRange>();
            var archetypeModel = node.GetPropertyValue<ArchetypeModel>(alias);
            if (archetypeModel != null && archetypeModel.Fieldsets != null)
            {
                foreach (var item in archetypeModel)
                {
                    dateRanges.Add(item.GetValue<Diplo.DateRangePicker.DateRange>("dateRange"));
                }
            }
            return dateRanges;
        }
    

    The package seems to be working fine for 7.4.3, the only bad thing is that I could't find it on NuGet.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies