From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pdm-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 16FEE1FF168 for <inbox@lore.proxmox.com>; Tue, 21 Jan 2025 10:46:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5A547567A; Tue, 21 Jan 2025 10:46:53 +0100 (CET) Message-ID: <d00931cf-7398-4dd2-a629-23e52527f9b2@proxmox.com> Date: Tue, 21 Jan 2025 10:46:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Thomas Lamprecht <t.lamprecht@proxmox.com>, Proxmox Datacenter Manager development discussion <pdm-devel@lists.proxmox.com> References: <20250120093006.927014-1-d.csapak@proxmox.com> <20250120093006.927014-2-d.csapak@proxmox.com> <6bedbd8e-8b5e-4888-8cbf-bc9b89b18fdf@proxmox.com> <c22d1e83-b0d4-4f74-88f7-49a0082393e1@proxmox.com> <804e0026-dbc6-4602-8fc6-27895ff69e3f@proxmox.com> Content-Language: en-US From: Dominik Csapak <d.csapak@proxmox.com> In-Reply-To: <804e0026-dbc6-4602-8fc6-27895ff69e3f@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH yew-comp 1/7] tasks: make date filter functional X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion <pdm-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pdm-devel>, <mailto:pdm-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pdm-devel/> List-Post: <mailto:pdm-devel@lists.proxmox.com> List-Help: <mailto:pdm-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel>, <mailto:pdm-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox Datacenter Manager development discussion <pdm-devel@lists.proxmox.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" <pdm-devel-bounces@lists.proxmox.com> On 1/21/25 09:33, Thomas Lamprecht wrote: > Am 20.01.25 um 13:10 schrieb Dominik Csapak: >> On 1/20/25 12:30, Thomas Lamprecht wrote: >>> Am 20.01.25 um 10:29 schrieb Dominik Csapak: >>>> + let since = (since.get_time() / 1000.0).round() as u64; >>> >>> Is round doing something here? Could only be the case if one could enter >>> milliseconds in the since/until strings, and if that would be the case >>> it might be better to just call set_milliseconds(0) too. >> >> We currently rely on the browser to display a date time selector, and since >> this is browser dependent, we technically cannot really know what we're getting here. >> >> so the round was just to be overly careful to respect the input, but yeah >> simply omitting the round to truncate the decimal places seems better. >> >> and 'f64 as u64' already does rounds to zero, so i'll send a follow up to remove the round() > > Alternatively one could use .trunc() then I guess, albeit rounding towards zero > should be actually already do exactly the same thing I think. > >> to reference the offical rust docs for 'as': >> https://doc.rust-lang.org/1.84.0/reference/expressions/operator-expr.html#type-cast-expressions > > Thanks for looking this actually up! i already sent a patch for this on yew-devel (since it's not related to pdm): https://lore.proxmox.com/yew-devel/20250120124146.2952068-1-d.csapak@proxmox.com/ without truncate (just the type casting) please let me know if that's enough or if you'd prefer a manual truncate _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel