angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

UI Calendar seemingly showing no dates #314

Closed qthen closed 9 years ago

qthen commented 9 years ago

So, I've been struggling with this issue for a few hours. I have UI Calendar in my code and an array of eventSources to give to it. This is my eventSource JSON code:

[ 
   {
        "color": "#f00", 
        "textColor": "yellow", 
        "events": [ 
            {
                "start": "2015-09-21T04:00:00.000Z", 
                "end": "2015-09-22T04:00:00.000Z", 
                "title": "Sports" 
            }, 
            { 
                "start": "2015-09-01T04:00:00.000Z", 
                "end": "2015-09-01T04:00:00.000Z", 
                "title": "Another Day" 
            }, 
            { 
                "start": "2015-09-01T05:00:00.000Z", 
                "end": "2015-09-01T05:00:00.000Z", 
                "title": "Date" 
            }, 
            { 
                "start": "2015-09-03T04:00:00.000Z", 
                "end": "2015-09-03T05:00:00.000Z", 
                "title": "Hangout Date" 
            } 
        ] 
    } 
]

The start and end are a bit weird above due to the way I outputed the JSON, but they log in the console like this:

start: Thu Sep 03 2015 01:00:00 GMT-0400 (Eastern Daylight Time)
end: Thu Sep 03 2015 01:00:00 GMT-0500 (Eastern Daylight Time)

However, my calendar is completely empty. No errors are logged into the console as well. I have tried using a different JSON format such as:

[
    [
       events Array here
    ]
]

To no avail. Does anyone know what could be happening? This is my full JS code:

$provide.value('convertMySQLToJS', function(arrayInput) {
    for (var i = 0; i < arrayInput.length; i++) {
        var t = arrayInput[i].begin_datetime.split(/[- :]/);
        var start = new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);
        var t = arrayInput[i].end_datetime.split(/[- :]/);
        var end = new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);
        var title = arrayInput[i].datename;
        arrayInput[i] = {
            start: start,
            end: end,
            title: title
        };
    }
    return arrayInput;
});
var dates = convertMySQLToJS(successResponse.data);
$scope.data.dates = [
    {
        color: '#f00',
        textColor: 'yellow',
        events: dates
    }
];

HTML code:

<div ng-if="data.dates">
    <div ui-calendar ng-model="data.dates"></div>
</div>
Lakret commented 9 years ago

Having the same problem, no luck so far. Is anybody supporting this project anyway?

antoinepairet commented 9 years ago

@kuroware Please provide a plunkr or a jsfiddle with your code. It will be easier to get help. rgds @Lakret, @jkurz maintains this angular module

qthen commented 9 years ago

I fixed this by setting the ng-model specifically to $scope.eventSource as specified in the demo. I also changed the variable holding the events to $scope.eventSources. For some reason, this fixed everything.

antoinepairet commented 9 years ago

@kuroware Great you found a solution. Please close the issue

@jkurz I could help your with simple issues like this. Would you consider giving me write access to the repo?

Regards!

shyamal890 commented 8 years ago

@antoinepairet I don't think @jkurz or @Lakret are active on this project anymore. I wonder whether any AngularUI-member would be taking over this project?

I think @martin-langhoff is also willing to contribute.

jkurz commented 8 years ago

hell yes, I have been long removed from this project. Not because I don't want to contribute, but because of time constraints. I have added people in the past to this project but nobody has really stepped up and started knocking things out. So if we do add someone they need to be gung ho about it. @martin-langhoff @antoinepairet @shyamal890 if any of you are interested, please shoot me an email at jkurz25@gmail.com and I will add you. Thanks

martin-langhoff commented 8 years ago

I am in :-)

Cannot promise super-active maintainership, but I am a user of this project and have a long track record in FOSS work - see https://www.openhub.net/accounts/martin_langhoff

(Also copying this to email)

joshkurz commented 8 years ago

@ProLoser looks like I can't add people as team members anymore. could you add @martin-langhoff as a new member of this project?

ProLoser commented 8 years ago

@joshkurz You should be able to administer the UI team now, but perhaps we should break out a new team? Anyway, I'll add him as a collaborator on this repo for now (instead of to the UI team)

martin-langhoff commented 8 years ago

thank you! I seem to have access, so extra thanks for the trust. Will take a careful approach and try gather advise from experienced hands.

As an initial move, I will create a new issue to discuss maintainership, separate from this specific bug.

martin-langhoff commented 8 years ago

Created #395 -- anyone interested in maintainership, pls join me there :-) and we let this bug follow its natural course.

joshkurz commented 8 years ago

@proloser a separate team sounds good to me.

ProLoser commented 8 years ago

@joshkurz I've made you a team maintainer and added the 2 calendar repos to the team. If you need to feel free to add any further repos. Would you mind adding the rest of the team members?

joshkurz commented 8 years ago

Thanks @proloser I'll add everyone else.