• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript entcore.moment函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript entcore.Behaviours类代码示例发布时间:2022-05-25
下一篇:
TypeScript entcore.http函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap