当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript entcore.moment函数代码示例

本文整理汇总了TypeScript中entcore.moment函数的典型用法代码示例。如果您正苦于以下问题:TypeScript moment函数的具体用法?TypeScript moment怎么用?TypeScript moment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了moment函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

                link: (scope:any) => {

                    // Get data
                    scope.subjectCopyList = [];
                    SubjectCopyService.resolve(false).then(
                        function () {
                            scope.subjectCopyList = SubjectCopyService.getList();
                        }
                    );
                    SubjectScheduledService.resolve(false).then(
                        function(){
                        }
                    );

                    // Date
                    scope.today = new Date();
                    scope.dateInAWeek = moment().startOf('week').add(1, 'week').toDate();
                    scope.dateInAYears = moment().add(1, 'year').toDate();

                    // Search
                    if (!scope.search) {
                        scope.search = {
                            beginDate: moment().startOf('week').add(1, 'week').toDate(),
                            endDate: moment().add(3, 'month').toDate()
                        }
                    }
                }
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:27,代码来源:studentDashBoardSubjectCopyList.ts

示例2: function

 scope.modifySchedule = function () {
     var subjectScheduled = {
         id:scope.selectedSubjectScheduled.id,
         begin_date:moment(scope.option.begin_date).hours(14).minutes(0).seconds(0)
             .toISOString().replace(/T..:../, "T"+scope.option.begin_time),
         due_date:moment(scope.option.due_date).hours(14).minutes(0).seconds(0)
             .toISOString().replace(/T..:../, "T"+scope.option.due_time)
     };
     SubjectScheduledService.modifySchedule(subjectScheduled).then(
         function() {
             window.location.reload();
         },
         function(err) {
             notify.error(err);
         }
     );
 }
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:17,代码来源:teacherDashboardCorrectionCopyList.ts

示例3: async

 $scope.saveDraft = async (item) => {
     try {
         await Conversation.instance.folders.draft.saveDraft(item);
         $scope.state.draftError = false;
         $scope.state.draftSaveDate = moment();
     }
     catch (e) {
         $scope.state.draftError = true;
     }
 };
开发者ID:entcore,项目名称:entcore,代码行数:10,代码来源:controller.ts

示例4: function

                scope.order.order = function(item){
                    if(scope.order.field === 'submitted_date' && item.submitted_date){
                        return moment(item.submitted_date);
                    }

                    if(scope.order.field.indexOf('.') >= 0){
                        var splitted_field = scope.order.field.split('.')
                        var sortValue = item
                        for(var i = 0; i < splitted_field.length; i++){
                            sortValue = (typeof sortValue === 'undefined' || sortValue === null) ? undefined : sortValue[splitted_field[i]]
                        }
                        return sortValue
                    } else
                        return (item[scope.order.field]) ? item[scope.order.field] : undefined;
                };
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:15,代码来源:teacherDashboardSimpleCorrectionCopyList.ts

示例5: function

directory.User.prototype.saveAccount = function(cb){
	var accountData = {
		lastName : this.lastName,
		firstName: this.firstName,
		type: this.type,
		birthDate: moment(this.birthDate).format('YYYY-MM-DD')
	} as any;
	if(this.type === 'Relative'){
		accountData.childrenIds = _.map(this.relatives, function(user){
			return user.id;
		});
	}
	oldHttp().postJson('/directory/class/' + model.me.preferences.selectedClass + '/user', accountData).done(function(data){
		this.updateData(data);
		if(typeof cb === 'function'){
			cb();
		}
	}.bind(this));
};
开发者ID:entcore,项目名称:entcore,代码行数:19,代码来源:model.ts

示例6: function

	$scope.longDate = function(dateString){
		return moment(dateString).format('DD MMMM YYYY')
	};
开发者ID:entcore,项目名称:entcore,代码行数:3,代码来源:account.ts

示例7: moment

            link: (scope:any) => {

                scope.search = {
                    groupList: [],
                    beginDate: moment().subtract(3, 'month').toDate(),
                    endDate: moment().add(3, 'month').toDate(),
                };


                scope.selectedSubjectsScheduled=[];



                scope.getSubjectScheduledPicture = function (subjectScheduled) {
                    return subjectScheduled.picture || skin.basePath + 'img/illustrations/image-default.svg';
                };


                scope.filterOnSubjectScheduledDueDate = function (begin, end) {
                    return function (subjectScheduled) {
                        var dueDate = DateService.isoToDate(subjectScheduled.due_date);
                        if (!begin || !end) {
                            throw "begin or end date in params missing"
                        }
                        return DateService.compare_after(dueDate, begin, true) && DateService.compare_after(end, dueDate, true);
                    }
                };

                scope.orderByCopyListModificationDate = function(id){
                    var copyList = ArchivesService.getSubjectScheduledCopyById(id);
                    var lastUpdateCopy:any = null;
                    angular.forEach(copyList, function(copy){
                        if(lastUpdateCopy){
                            if(DateService.compare_after(DateService.isoToDate(copy.modified), DateService.isoToDate(lastUpdateCopy))){
                                lastUpdateCopy = copy;
                            }
                        } else{
                            lastUpdateCopy = copy;
                        }
                    });
                    if(lastUpdateCopy != null && lastUpdateCopy.modified != null){
                        return lastUpdateCopy.modified;
                    }
                }


                scope.selectsubjectScheduled = function(subjectScheduled){
                    if(subjectScheduled.selected){
                        scope.selectedSubjectsScheduled.push(subjectScheduled);
                    }else{
                        scope.selectedSubjectsScheduled.pop(subjectScheduled);
                    }

                }
                scope.clickOnSubjectScheduled = function(subjectScheduled){
                    scope.selectedSubjectScheduled = subjectScheduled;
                    $location.path('/dashboard/teacher/archive/'+subjectScheduled.id);
                };

                scope.exportAll = function(){
                    exportCSV(scope.subjectScheduledList);
                };

                scope.exportSelected = function(){
                    exportCSV(scope.selectedSubjectsScheduled);
                }

                function exportCSV(subjects:ISubjectScheduled[]) {
                    var ids:string = "?"
                    subjects.forEach((subject) =>{
                        ids = ids.concat("id="+subject.id+"&");
                    } );
                    window.location.href = '/exercizer/archive/subjects-scheduled/export-csv' + ids.slice(0,-1);
                }
            }
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:75,代码来源:dashboardArchives.ts

示例8: moment

				Birthday.birthdays = Birthday.birthdays.sort(function(a, b){
					return moment(a.birthDate).date() - moment(b.birthDate).date()
				});
开发者ID:entcore,项目名称:entcore,代码行数:3,代码来源:birthday.ts


注:本文中的entcore.moment函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。