Comments (12)
removing allowEmpty from global config doesnt fix the formating..
Passing 'DD.MM.YYYY' in the hbs works. So it just dont read from global config anymore
from ember-moment.
I don't think they're related, I rewrote a large chunk and might have introduced something
from ember-moment.
what version of ember?
from ember-moment.
sadly 1.13.8 due to deprecation stuff ...
from ember-moment.
That's fine, that's actually ideal right now since it's using Ember.Helper. I'll work on fixing it now.
from ember-moment.
Another thing I discovered is when passing a null date.
the readme says If null, undefined, or an empty string as a date to any of the moment helpers then you you will Invalid Date in the output. To avoid this issue globally, you can set the option allowEmpty which all of the helpers respect and will result in nothing being rendered instead of Invalid Date.
In fact it renders the current date.
from ember-moment.
Another thing I discovered is when passing a null date.
I can't reproduce this one
from ember-moment.
Hm .. Might be an other interesting thing in the ember universe :)
But since I can set allowEmpty it doesnt kill me anymore.
from ember-moment.
3.6.1 released
If you can show me an example of the null rendering the current date I'd like to try and see what is going on there but tried it on all the helpers and I'm seeing Invalid Date as expected when allowEmpty is false in the global config
from ember-moment.
I cant provide an example since my project is from my company and this would break some copyright shit and so on :-/
But i can tell you the way I go :)
I am using ember data to get, as you expect, data from my api.
if a date is not set my api wont return the field. So the field should be null / unset.
my global config looks like above, without allowEmpty. And so the hbs.
I will try to get an example with mirage running later at home.
//edit
Now that the global format is working again it will produce 19.08.2015 for me.
from ember-moment.
If you can isolate the issue and shoot me an example that would be awesome. I don't use ember-data much these days and would probably spin my wheels trying to reproduce it.
What I think is happening is the thing you think is null is not null. You can log the prop using the {{log propKey}}
helper
from ember-moment.
Nice i didn't knew the {{log}}. I'm quiet new to ember ^^
{{log model.someDate}} produces:
Wed Jun 26 2013 00:00:00 GMT+0200 (Westeuropäische Sommerzeit)
Mon Jun 10 2013 00:00:00 GMT+0200 (Westeuropäische Sommerzeit)
3x undefined
The 3 undefined "dates" are the one which will produce the current date.
I will try to setup an empty reproducing project and leave you a message.
Thanks so far.
from ember-moment.
Related Issues (20)
- startOf('day') gets previous day using ember-moment service
- Timezone doesn't apply HOT 3
- [ember-moment] attempted to set timezone, but moment-timezone is not setup. HOT 2
- "Invalid date" in Safari HOT 1
- Using ember-moment in Ember 3.18 fails to produce production build HOT 8
- When calling `deprecate` you must provide `for` in options. Missing options.for in "ember-moment.addon.helpers.moment-to-now" deprecation
- Import `computed.bool` from the right package HOT 8
- error starting ember with ember-moment HOT 1
- Ember Global deprecation warning due to old version of ember-cli-babel
- `services/moment.js` bug in `defaultFormat` HOT 3
- moment-timezone dependency added HOT 5
- toggling locales does not take effect
- Is ember-cli-moment-shim still required for ember-moment? HOT 3
- Timezone not accesible after upgrading to version 9 HOT 2
- Environment configuration does not work as documented HOT 2
- Update dependency `@embroider/addon-shim` to `^1.0.0`
- Display an optional message when date is null/invalid/undefined
- Documentation incorrect for environment settings
- ember-moment is trying to import from ember-cli-moment-shim but that is not one of its explicit dependencies Error thrown while using Embroider compat build HOT 15
- Error importing moment-timezone with ember-auto-import 2.6.2 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-moment.