adopted-ember-addons / adopted-ember-addons/ember-moment
Display an optional message when date is null/invalid/undefined
- 主要言語
- JavaScript
- スター
- 398
- フォーク
- 120
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
The default behavior when the helper receives an invalid input is to return **Invalid Date**.
Optionally, from docs we can allow empty dates to be passed but it returns nothing:
> ```{{moment-format '' allow-empty=true} {{!-- --}}```
But it could help a lot in my case if I could define an optional message. I'm currently doing this via a template helper:
```js
export function formattedDate([date]) {
return date ? moment(date).format('DD/MM/YY') : 'indisponível';
}
export default helper(formattedDate);
```
If possible, I'd like to eliminate this helper.
コントリビューションガイド
調査の方向性
Start with the moment-format helper and the documentation examples for allow-empty, then trace how empty, invalid, and undefined inputs are handled. Done means an optional message can be specified for those inputs while the existing default and allow-empty behavior remain documented and tested.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100