< 072020-06-08⋎09 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
08:03*JustTB has quit (Quit: Leaving.)
08:37*JustTB has joined
09:04skipper_is[m]Yea, the one thing is that it doesnt' take into account the time zone formatting of the region. So for most of the world, dd/mm/yyyy, but for the US.... Well, you know what you've done USA....
09:07skipper_is[m]It would be nice to have it on the main page, but it would require calling all logs with weight to filter out the last 2, rather than the current function that just gets the latest. I'm just wondering whether that'd negativly impact load times much
12:15skipper_is[m]Ooh, does date() use the local timezone formatting of the server?
12:18mstenta[m]skipper_is: yea I think `date()` will use the timezone from the server/user
12:18mstenta[m]it takes a UNIX timestamp, which is always UTC
12:19mstenta[m]and then within PHP there are a few levels of "timezone"... system level (the server itself), site (the site-wide Drupal default timezone), user (each Drupal user can set their own timezone, which overrides the site-wide one)
12:20mstenta[m]err... actually maybe `date()` doesn't have knowledge of the Drupal level stuff
12:20mstenta[m]but `format_date()` would
12:20mstenta[m]api.drupal.org/api/drupal/includes%21com
12:23skipper_is[m]Yea, but format_dates formats are with the time, and I'm just after the date.. even format short
12:24mstenta[m]ah you can use `custom` to change that
12:24mstenta[m]`format_date($timestamp, $type = 'custom', $format = 'd/m/Y');`
12:25skipper_is[m]<mstenta[m] "but `format_date()` would"> But is it then respecting the m/d/y that the US insists on using?
12:25skipper_is[m]Because I could achieve that effect with date()
12:25mstenta[m]Hmm yea this is a bigger question :-)
12:25skipper_is[m]At least with date() it'll follow the server formatting
12:26mstenta[m]Probably something we want to address at a system-wide level somehow in farmOS
12:26skipper_is[m]Drupal wide I think...
12:26mstenta[m]Yes
12:26skipper_is[m]A short format_date that only does date
12:26mstenta[m]And Drupal DOES have some support for this already... I just don't have much experience modifying it
12:26mstenta[m]Ah gotcha (sorry still catching up here, and waking up ha)
12:27mstenta[m]Yea, I've wanted that in the past too... a short format without time
12:30skipper_is[m]I'll stick with date() at the moment, so it can take it from server php settings
12:32skipper_is[m]But I've made a new livestock_weight function that gets all records with weights, and another that takes the most recent 2 records and calculates the daily liveweight gain
12:33skipper_is[m]I might refactor the individual weight report page to use that function as well
12:33mstenta[m]Coool!
12:35skipper_is[m]The function is just a modification on the lines that call all weight records in the individual report, but pulled into its own function so I can reuse the code
13:03*jgaehring[m] has joined
13:53skipper_is[m]Well, it mostly works. Wording wise, I'm not so sure
13:53skipper_is[m]Also, does the output get t() before it rendered?
13:54skipper_is[m]..And it is refusing to allow me to upload images...
13:56skipper_is[m]It's a race of PC against phone..
13:57skipper_is[m]Both have lost... Error 520 from riot!
13:57skipper_is[m]pasteboard.co/Jc8Xhtp.png
13:57skipper_is[m]There we go
13:58mstenta[m]oh very cool!!!
13:58skipper_is[m]The load time of the get_all function vs without was the same
13:58mstenta[m]re: `t()` i think the only thing that should be translatable is the "Daily Liveweight Gain since" portion
13:58skipper_is[m]I'll refactor the individual weight report page to use that function, and push it
13:59mstenta[m]There's a good overview of using the `t()` function with placeholders here: api.drupal.org/api/drupal/includes%21boo
14:00skipper_is[m]The existing weights pages aren't translated
14:00skipper_is[m]So I assumed the whole output went through translate, but maybe not
14:02mstenta[m]ah ok that might be an oversight
14:02mstenta[m]no, only individual strings can be translated
14:03skipper_is[m]Ah ok, I'll refactor that while I'm there :)
14:04skipper_is[m]Got to go shift some chickens first o/
14:51paul121[m]Cool!
14:57*todrobbins[m] has joined
17:31skipper_is[m]So with t(), translating text containing html - split the text and the HTML tags, and translate just the text?
17:44*farmBOT has joined
17:45mstenta[m]Yea usually
17:45mstenta[m]If the translated text includes a link or something else that needs to be translated, then that's an exception
17:46mstenta[m]The API.drupal.org page describes that I think
17:50*JustTB has quit (Quit: Leaving.)
17:58skipper_is[m]Yea, so inline tags were fine
17:58skipper_is[m]So <strong> is ok
17:58skipper_is[m]But unfortunately my addition of t() as broken something, somewhere.... and the weights nolonger appear on the profile page
17:58skipper_is[m]farm_livestock_weight_entity_view_alter nolonger seems to be firing
18:23skipper_is[m]I removed everything I changed from the server, and restored it back to the original FarmOS, and it is still not there
18:28skipper_is[m]...Clear CC...
18:34mstenta[m]Ah did CC help?
18:34mstenta[m]Was gonna suggest that
18:43skipper_is[m]Yea, straight away XD
18:44skipper_is[m]Just writing a pull now
20:09*lpuro[m] has joined
22:02*JustTB has joined
22:22*JustTB has quit (Quit: Leaving.)
22:25*JustTB has joined
23:52*laurademmel[m] has joined

< 072020-06-08⋏09 >