[Koha-bugs] [Bug 24455] Date formatting from JS

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 18 17:00:11 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455

--- Comment #43 from Agustín Moyano <agustinmoyano at theke.io> ---
(In reply to Agustín Moyano from comment #42)
> (In reply to Martin Renvoize from comment #39)
> > I'm facing similar challenges here as I did with bug 24454.
> > 
> > Now I'm wrapping my head around it, there seems to be a fair bit of
> > duplicate code introduced here that already exists in
> > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
> > 
> > I'm by no means against introducing moment.js, I like the idea of using well
> > maintained and thought out third party libraries and the was of accessing
> > the functions written here is nice and elegant.. much like the way you
> > introduced elegant accessors for currency handling in bug 24454 (I'd like to
> > see some of those idea's taken forward too).
> > 
> > But.. I don't like that we're duplicating logic and making it somewhat less
> > clear which functions should be used for the job so would like some form of
> > merge/aggregation of such functionality and a clear documentation somewhere
> > for how to use it before I'm happy pushing this.
> 
> Hello Martin, functions in calendar.inc has similar logic, but they do the
> oposite job of this functions.
> 
> calendar.inc function's inputs are date/datetime strings as specified by
> dateformat preference and returns a JS Date object.
> 
> This function's inputs are date/datetime string as returned from the api
> (RFC3339) and returns a date/datetime/time string as specified by dateformat
> preference, and translated to corresponding timezone.

I believe Calendar.inc functions are used to get a date from tt variable, and
put that date into a jquery calendar input.

This functions should be used to format dates from the api

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list