当前位置: 首页 > 软件库 > 程序开发 > >

ember-luxon

授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 乌骏
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

ember-luxon

Deprecated. I no longer work with Ember so it's tricky to keep this up to date. If you require this library, I'd suggest forking it. Alternatively, install luxon directly and copy the helpers in.

An addon to allow importing of Luxon in your Ember Apps.

Installation

  • ember install ember-luxon;

Most modern browers will work fine with luxon. If you need to support legacy browsers you will need to include some polyfills.

You can provide an option in your apps ember-cli-build.js file and we'll add intl.js to your build.

'ember-luxon': {
  includeIntlPolyfill: true
}

See the Luxon support matrix for more information and which browsers support which features and other caveats.

Usage

import { DateTime, Duration, Info, Interval, Settings, Zone } from 'ember-luxon';
import Component from '@ember/component';

export default Component.extend({
  theTime: computed(function() {
    return DateTime.local()
  })
});

Helpers

Ember luxon provices some helpers for use in templates.

luxon

Given a string and a format it will generate a luxon datetime object.

{{luxon "2014 Aug 06" "yyyy LLL dd"}}

luxon-diff

This will determine the length of time between two days.Precision is optional and will default to milliseconds.

{{luxon-diff dateOne dateTwo}}                  /* 86400000
{{luxon-diff dateOne dateTwo precision="days"}} /* 1

luxon-format

Given a datetime object it will format it. If you don't provide a format stringember-luxon will default to using local formatting.

{{luxon-format dateOne format="yyyy LLL dd"}} /* "2014 Aug 06"
{{luxon-format dateOne}}                      /* "4/20/2017"

luxon-is-after

Will return true or false depending on whether the first dateTime is after the second.

{{luxon-is-after earlyDate lateDate}} /* true
{{luxon-is-after lateDate earlyDate}} /* false

luxon-is-before

Will return true or false depending on whether the first dateTime is before the second.

{{luxon-is-before earlyDate lateDate}} /* true
{{luxon-is-before lateDate earlyDate}} /* false

luxon-is-before

Will return true or false depending on whether the first dateTime is contained within a pair of dates.

{{luxon-is-before dateTime startDate endDate}} /* true

luxon-is-same

Will return true or false depending on whether the first dateTime is the same as the other date.You can set the precision here to verify if it is the day, millisecond, hour etc.

{{luxon-is-same dateTime dateTime}}                        /* true
{{luxon-is-same dateTime dateTimeTwo precision="day"}}     /* true
{{luxon-is-same dateTime dateTimeThree precision="month"}} /* true
 相关资料
  • Ember检查器是一个浏览器插件,用于调试Ember应用程序。 灰烬检查员包括以下主题 - S.No. 灰烬检查员方式和描述 1 安装Inspector 您可以安装Ember检查器来调试您的应用程序。 2 Object Inspector Ember检查器允许与Ember对象进行交互。 3 The View Tree 视图树提供应用程序的当前状态。 4 检查路由,数据选项卡和库信息 您可以看到检查

  • 英文原文: http://emberjs.com/guides/getting-ember/index/ Ember构建 Ember的发布管理团队针对Ember和Ember Data维护了不同的发布方法。 频道 最新的Ember和Ember Data的 Release,Beta 和 Canary 构建可以在这里找到。每一个频道都提供了一个开发版、最小化版和生产版。更多关于不同频道的信息可以查看博客

  • ember-emojione ember-emojione is your emoji solution for Ember, based on the EmojiOne project. EmojiOne version 2 is used, which is free to use for everyone (CC BY-SA 4.0), you're only required to giv

  • Ember 3D Ember 3D is an Ember addon for using Three.js - an easy to use, lightweight, javascript 3D library. It is designed to: Prescribe a solid file structure to Three.js code using ES6 modules. Ena

  • Ember Table An addon to support large data set and a number of features around table. Ember Table canhandle over 100,000 rows without any rendering or performance issues. Ember Table 3.x supports: Emb

  • vscode-ember This is the VSCode extension to use the Ember Language Server. Features All features currently only work in Ember-CLI apps that use classic structure and are a rough first draft with a lo