日期格式被划分,我得到完全不同的值

发布于 2024-12-29 00:15:42 字数 601 浏览 1 评论 0原文

我有一些 javascript 应该带来一些值来更改链接,但问题是日期格式写为: dd/mm/year 因此日期先除以月,然后除以年:) 这是函数:

function show_sales(employee_id,start_date,finish_date)
    {
      var url_str = "#request.self#?fuseaction=objects2.popup_showsales_emp"
      url_str = url_str + '&employee_id=' + employee_id;
      url_str = url_str + '&start_date=' + start_date;
      url_str = url_str + '&finish_date=' + finish_date;
      AjaxPageLoad(url_str,'salesdiv_' + employee_id,1,'Yükleniyor');
    }

as u可以看到我想获取开始日期和完成日期来更改链接,但它会计算值))所以我得到的不是:02/01/2012 0.0009940357852882703 :) 谢谢大家的帮助!

i have a little javascript that should bring some values to change the link, but the problem is that date format is written like: dd/mm/year thus the day is divided by month then by year :) here is the function:

function show_sales(employee_id,start_date,finish_date)
    {
      var url_str = "#request.self#?fuseaction=objects2.popup_showsales_emp"
      url_str = url_str + '&employee_id=' + employee_id;
      url_str = url_str + '&start_date=' + start_date;
      url_str = url_str + '&finish_date=' + finish_date;
      AjaxPageLoad(url_str,'salesdiv_' + employee_id,1,'Yükleniyor');
    }

as u can see i want to get the start date and finish date to change the link, but instead it counts the value )) so instead of getting: 02/01/2012 i get: 0.0009940357852882703 :) thank you all for the help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

苦行僧 2025-01-05 00:15:42

我希望函数调用中存在问题

function show_sales(1,'12/3/2008','15/5/2012');

,确保日期格式为字符串

i hope there is a prob in function call

function show_sales(1,'12/3/2008','15/5/2012');

make sure that date is formatted as string

往日情怀 2025-01-05 00:15:42

我不太确定我是否理解你的意思,但这可能会有所帮助:

function show_sales(employee_id,start_date,finish_date)
{
    var url_str = "#request.self#?fuseaction=objects2.popup_showsales_emp"
    url_str = url_str + '&employee_id=' + encodeURIComponent(employee_id);
    url_str = url_str + '&start_date=' + encodeURIComponent(start_date);
    url_str = url_str + '&finish_date=' + encodeURIComponent(finish_date);
    AjaxPageLoad(url_str,'salesdiv_' + employee_id,1,'Yükleniyor');
}

I am not quite sure if I have understand you but this may help:

function show_sales(employee_id,start_date,finish_date)
{
    var url_str = "#request.self#?fuseaction=objects2.popup_showsales_emp"
    url_str = url_str + '&employee_id=' + encodeURIComponent(employee_id);
    url_str = url_str + '&start_date=' + encodeURIComponent(start_date);
    url_str = url_str + '&finish_date=' + encodeURIComponent(finish_date);
    AjaxPageLoad(url_str,'salesdiv_' + employee_id,1,'Yükleniyor');
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文