On Sunday, May 31, 2015 at 6:04:30 PM UTC+2, Sander Elias wrote:
>
> Hi Ahmed,
>
> I'm not sure what you mean, something like this: 
> http://plnkr.co/edit/IffcD4Cu2BLevRA8Ghar?p=preview
> ??
>
> doesn't have anything to do with angular actually ;)
>
> Regards
> Sander
>

*Hi Sander,*

*Thanks it's close from what i need - but i need here to get the count of 
day's not get them as 4,5,6,...... - so please how can i do that here *

*i try it as and it works:*

        $scope.calcdates = function (month, year) {
            var day = 1;
            var start = new Date(Date.UTC(year, month - 1, day, 0, 0, 0)); 
//cals first day of month
            var end = new Date(Date.UTC(year, month, 0, 0, 0, 0)); //last 
day of month
            var days = [0, 0, 0, 0, 0, 0, 0]; //start of with 7 empty slots 
to count the dyas (0=sunday...)
            //var parsed = [] //to show the right dates are proccessed, can 
be dropped

            //loop over the month
            for (; start <= end; start = new Date(Date.UTC(year, month - 1, 
++day, 0, 0, 0))) {
                days[start.getDay()] += 1; //add each day to it slot
                //parsed.push(start); //prove POC
            }

            return {
                days: days
            }
        };

and use it as:

{{calcdates(6,2015)}}

*but please how can i make it works only on selected days from checkbox ? 
(i mean not all days of week) as example:*

*some employee works on "Saturday"; "Sunday"; "Monday"; "Tuesday"; 
"Wednesday"; "Thursday" - here i will got all days expect Friday only (6 
days per week) - so here i will need count of days that employee will 
worked on the month without any Friday *

*and some employee works on "Saturday"; "Monday"; "Wednesday" - here  (3 
days per week) - here i will got count of "Saturday"; "Monday"; "Wednesday" 
days in the month only without any other days on the week*

*and ect .....*

*i hope you got what i mean*

*thanks a lot ....*

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to