How to use the framework/Util.secondsToHMSFormat function in framework

To help you get started, we’ve selected a few framework examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / news / NewsFeedViewController.js View on Github external
if ((j > 0 && (j + 1) % 4 == 0) || j == videosLen - 1) {
                            carouselSlides.push({
                                videos: carouselSlide
                            });
                            carouselSlide = [];
                        }
                    }

                    currentActivity.collection._carouselSlides = carouselSlides;

                    // format
                    collectionStats.likes = Util.integerCommaFormat(collectionStats.likes);
                    collectionStats.views = Util.integerCommaFormat(collectionStats.views);
                    collectionStats.adoptions = Util.integerCommaFormat(collectionStats.adoptions);
                    collectionStats.totalDuration = Util.secondsToHMSFormat(collectionStats.totalDuration);

                    currentActivity.collection._collectionStats = collectionStats;
                }
            }
        },
github digitalgreenorg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
var i = 0;
            var j;
            var len = collectionsArray.length;
            for (; i < len; i++) {
                var currentCollectionData = Util.Object.clone(collectionsArray[i], true);
                currentCollectionData._index = i;
                currentCollectionData._collectionStats = this._getCollectionStats(currentCollectionData);
                currentCollectionData._plural = (currentCollectionData.videos.length != 1);

                // render collections
                entireRenderedHTML += viewRenderer.render(collectionTemplate, currentCollectionData);
                
                // add length to each video
                for (j = 0; j < currentCollectionData.videos.length; j++) {
                    currentCollectionData.videos[j]._time = Util.secondsToHMSFormat(currentCollectionData.videos[j].duration);
                }

                // organize videos into slides
                var videoDrawerData = this._prepareVideoDrawerData(currentCollectionData.videos);
                
                // assign remaining needed rendering data
                videoDrawerData._index = i;

                // store the video drawer data
                tempVideoDrawerArray.push(videoDrawerData);

                // once we've displayed our desired amount of videos in this column.
                // include accumulated video drawer html with the overall html
                if ((i + 1) % collectionsPerRow == 0 || i == len - 1) {
                    entireRenderedHTML += viewRenderer.render(collectionVideoDrawerTemplate, {
                        _videoDrawerClasses: videoDrawerClasses,
github digitalgreenorg / dg / media / social_website / scripts / app / view-controllers / news / NewsFeedViewController.js View on Github external
if ((j > 0 && (j + 1) % 4 == 0) || j == videosLen - 1) {
                            carouselSlides.push({
                                videos: carouselSlide
                            });
                            carouselSlide = [];
                        }
                    }

                    currentActivity.collection._carouselSlides = carouselSlides;

                    // format
                    collectionStats.likes = Util.integerCommaFormat(collectionStats.likes);
                    collectionStats.views = Util.integerCommaFormat(collectionStats.views);
                    collectionStats.adoptions = Util.integerCommaFormat(collectionStats.adoptions);
                    collectionStats.totalDuration = Util.secondsToHMSFormat(collectionStats.totalDuration);

                    currentActivity.collection._collectionStats = collectionStats;
                }
            }
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / profile / ActivitiesViewController.js View on Github external
if ((j > 0 && (j + 1) % 3 == 0) || j == videosLen - 1) {
                            carouselSlides.push({
                                videos: carouselSlide
                            });
                            carouselSlide = [];
                        }
                    }

                    currentActivity.collection._carouselSlides = carouselSlides;

                    // format
                    collectionStats.likes = Util.integerCommaFormat(collectionStats.likes);
                    collectionStats.views = Util.integerCommaFormat(collectionStats.views);
                    collectionStats.adoptions = Util.integerCommaFormat(collectionStats.adoptions);
                    collectionStats.totalDuration = Util.secondsToHMSFormat(collectionStats.totalDuration);

                    currentActivity.collection._collectionStats = collectionStats;
                }
            }
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / GenericCollectionsViewController.js View on Github external
var j;
            var len = collectionsArray.length;
            for (; i < len; i++) {
                var currentCollectionData = Util.Object.clone(collectionsArray[i], true);

                var itemIndex = (collectionsData.startPage * collectionsData.countPerPage) + i
                currentCollectionData._index = itemIndex;
                currentCollectionData._collectionStats = this._getCollectionStats(currentCollectionData);
                currentCollectionData._plural = (currentCollectionData.videos.length != 1);

                // render collections
                tempRenderHTML += viewRenderer.render(collectionTemplate, currentCollectionData);
                
                // add length to each video
                for (j = 0; j < currentCollectionData.videos.length; j++) {
                    currentCollectionData.videos[j]._time = Util.secondsToHMSFormat(currentCollectionData.videos[j].duration);
                }

                // organize videos into slides
                var videoDrawerData = this._prepareVideoDrawerData(currentCollectionData.videos);
                
                // assign remaining needed rendering data
                videoDrawerData._index = itemIndex;

                // store the video drawer data
                tempVideoDrawerArray.push(videoDrawerData);

                // once we've displayed our desired amount of videos in this column.
                // include accumulated video drawer html with the overall html
                if ((i + 1) % collectionsPerRow == 0 || i == len - 1) {
                    tempRenderHTML += viewRenderer.render(collectionVideoDrawerTemplate, {
                        _videoDrawerClasses: videoDrawerClasses,
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
var i = 0;
            var j;
            var len = collectionsArray.length;
            for (; i < len; i++) {
                var currentCollectionData = Util.Object.clone(collectionsArray[i], true);
                currentCollectionData._index = i;
                currentCollectionData._collectionStats = this._getCollectionStats(currentCollectionData);
                currentCollectionData._plural = (currentCollectionData.videos.length != 1);

                // render collections
                entireRenderedHTML += viewRenderer.render(collectionTemplate, currentCollectionData);
                
                // add length to each video
                for (j = 0; j < currentCollectionData.videos.length; j++) {
                    currentCollectionData.videos[j]._time = Util.secondsToHMSFormat(currentCollectionData.videos[j].duration);
                }

                // organize videos into slides
                var videoDrawerData = this._prepareVideoDrawerData(currentCollectionData.videos);
                
                // assign remaining needed rendering data
                videoDrawerData._index = i;

                // store the video drawer data
                tempVideoDrawerArray.push(videoDrawerData);

                // once we've displayed our desired amount of videos in this column.
                // include accumulated video drawer html with the overall html
                if ((i + 1) % collectionsPerRow == 0 || i == len - 1) {
                    entireRenderedHTML += viewRenderer.render(collectionVideoDrawerTemplate, {
                        _videoDrawerClasses: videoDrawerClasses,
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / GenericCollectionsViewController.js View on Github external
throw new Error('CollectionViewController._getCollectionStats(): trying to get collection stats on an object with no videos array');
            }

            var i = 0;
            var len = videos.length;
            for (; i < len; i++) {
                var currentVideo = videos[i];

                time += currentVideo.duration;
                adoptions += currentVideo.adoptions;
                views += currentVideo.offlineViews + currentVideo.onlineViews;
                likes += currentVideo.onlineLikes;
            }

            return {
                time: Util.secondsToHMSFormat(time),
                adoptions: Util.integerCommaFormat(adoptions),
                views: Util.integerCommaFormat(views),
                likes: Util.integerCommaFormat(likes)
            };
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
views = Util.integerCommaFormat(collectionData.views);
            	}
            	else{
            		views = Util.integerAbbreviatedFormat(collectionData.views);
            	}
            
            var likes = ''
            	if (collectionData.likes < 10000){
            		likes = Util.integerCommaFormat(collectionData.likes);
            	}
            	else{
            		likes = Util.integerAbbreviatedFormat(collectionData.likes);
            	}
            
            return {
                time: Util.secondsToHMSFormat(time),
                adoptions: adoptions,
                views: views,
                likes: likes
            };
        },
github digitalgreenorg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
var videos = collectionData.videos;

            if (!videos) {
                throw new Error('CollectionViewController._getCollectionStats(): trying to get collection stats on an object with no videos array');
            }

            var i = 0;
            var len = videos.length;
            for (; i < len; i++) {
                var currentVideo = videos[i];

                time += currentVideo.duration;
            }

            return {
                time: Util.secondsToHMSFormat(time),
                adoptions: Util.integerCommaFormat(collectionData.adoptions),
                views: Util.integerCommaFormat(collectionData.views),
                likes: Util.integerCommaFormat(collectionData.likes)
            };
        },