Comments (18)
@DianaLease would you have cycles to pick this one up, now that we have updated Concerto?
Sure thing! To make sure I understand the issue - wherever we use the native Date object to create dates in concerto-ui, we instead want to create dayjs date objects since that's what we ended up using in Concerto, correct?
yep!
from web-components.
A way around testing for the time being is included in PR accordproject/concerto-ui#27
from web-components.
Yes - I came across the following Deprecation Warning while running the Cicero Server locally.
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info. Arguments: [0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: December 17, 2017 03:24:00, _f: undefined, _strict: undefined, _locale: [object Object] Error at Function.createFromInputFallback (/Users/martin/Development/Accord/cicero/packages/cicero-server/node_modules/moment-mini/moment.min.js:1:3368) at Yt (/Users/martin/Development/Accord/cicero/packages/cicero-server/node_modules/moment-mini/moment.min.js:1:21318) at Ot (/Users/martin/Development/Accord/cicero/packages/cicero-server/node_modules/moment-mini/moment.min.js:1:22029) at Tt (/Users/martin/Development/Accord/cicero/packages/cicero-server/node_modules/moment-mini/moment.min.js:1:22111) at new c.parseZone (/Users/martin/Development/Accord/cicero/packages/cicero-server/node_modules/moment-mini/moment.min.js:1:50429) at JSONPopulator.convertToObject (/Users/martin/Development/Accord/cicero/packages/cicero-server/node_modules/@accordproject/concerto-core/lib/serializer/jsonpopulator.js:221:26)
from web-components.
@jeromesimeon I'm working on this.
from web-components.
@mttrbrts any thoughts on this issue?
from web-components.
We should be careful to only add other dependencies where necessary as they bloat the bundle in downstream apps.
Providing a robust implementation only for this one function should not necessarily require bringing in a whole date library.
This library doesn't have proper locale support now, so we should provide values in an RFC or ISO compliant format
from web-components.
We should be careful to only add other dependencies where necessary as they bloat the bundle in downstream apps.
Providing a robust implementation only for this one function should not necessarily require bringing in a whole date library.
This library doesn't have proper locale support now, so we should provide values in an RFC or ISO compliant format
Moment is already a dependency for concerto.
from web-components.
I would like to work on this, Kindly assign this to me.
from web-components.
Moment is already a dependency for concerto.
Concerto has moment-mini
not moment
as a dependency.
from web-components.
I'd also like to reconsider the DatePicker component that we use here, we shouldn't have to use non-standard date formats
from web-components.
I have changed moment to moment-mini @mttrbrts
from web-components.
Update on this: https://momentjs.com/docs/#/-project-status/
Maybe use https://moment.github.io/luxon/
from web-components.
Update on this: https://momentjs.com/docs/#/-project-status/
Maybe use https://moment.github.io/luxon/
Resolution on this, if any, should be consistent with whatever we decide on Concerto itself. See accordproject/concerto#205
from web-components.
@DianaLease would you have cycles to pick this one up, now that we have updated Concerto?
from web-components.
@DianaLease would you have cycles to pick this one up, now that we have updated Concerto?
Sure thing! To make sure I understand the issue - wherever we use the native Date object to create dates in concerto-ui, we instead want to create dayjs date objects since that's what we ended up using in Concerto, correct?
from web-components.
@dselman @jeromesimeon Looking into this more, I'm not sure it's actually necessary to introduce dayjs the way the current concerto-ui
code is implemented (a bit has changed since this issue was first opened). As far as I can tell, we only use the native Date object in these two places:
Here we use it to get the ISO string, so we are just using the string, not the object.
Here we use Date.now()
which just returns a number.
Since we aren't actually using a date object created by the native Date()
constructor, I don't think anything needs to be changed? Let me know if I am missing something!
from web-components.
@dselman @jeromesimeon Looking into this more, I'm not sure it's actually necessary to introduce dayjs the way the current
concerto-ui
code is implemented (a bit has changed since this issue was first opened). As far as I can tell, we only use the native Date object in these two places:Here we use it to get the ISO string, so we are just using the string, not the object.
Here we use
Date.now()
which just returns a number.Since we aren't actually using a date object created by the native
Date()
constructor, I don't think anything needs to be changed? Let me know if I am missing something!
ok that's actually interesting. In my mind we should either consistently use an object or consistently use a string. Maybe what you're suggesting is that we should use Date.now().toISOString()
in the second call listed?
(Apologies: I haven't really looked at this in details again, so I'm not even sure if I remember why I opened this issue)
from web-components.
@jeromesimeon The value of timestamp there is a number (typeof Date.now() === "number"
). But if we wanted to make it a string to be consistent we could do new Date().toISOString()
like we do in ui-concerto/src/utilities.js
. When I do that while running storybook locally and add a DateTime field to the concerto form demo, everything seems to work fine. However, I can't really figure out how timestamp
in ui-concerto/src/formgenerator.js
is used, if it even is at all? Removing it entirely also seem to cause no issues 🤷♀️ I don't think it's actually related to the concerto DateTime type.
from web-components.
Related Issues (20)
- installation error HOT 3
- Paragraphs above or below clause templates can't be deleted HOT 3
- Change markdown editor empty-state text HOT 4
- Overriding Default CSS
- web-components release 0.97 makes inconsistent assumptions about Concerto
- Adding Docstrings to the Project HOT 1
- Styling-Library HOT 11
- contract-editor error onChange: Cannot read property 'focus' of null HOT 5
- Change in Demo Text Of Markdown Editor HOT 2
- Adding Background In Inline Code HOT 6
- Heading Markdown Shortcut WYSIWYG (What You See Is What You Get) HOT 1
- npm install doesn't work for @accordproject/ui-markdown-editor HOT 5
- Undefined Nodes in some templates HOT 2
- Deployed github-page shows an Error 404 page. HOT 4
- Inline Markdown Shortcuts (WYSIWYG) HOT 2
- Update Readme HOT 1
- Formatting Button Error HOT 10
- [BUG]: Buttons not working HOT 4
- Implementation of PurgeCSS HOT 2
- Twitter icon is old. HOT 4
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 web-components.